Created
December 5, 2020 02:07
-
-
Save derrickturk/b4290d8c0a562aff11e87e9defee8f0f to your computer and use it in GitHub Desktop.
Idris 2 - looks like typecase is back on the menu, boys!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perverse : {a : Type} -> a -> a | |
perverse {a = Integer} x = x + 1 | |
perverse {a = String} x = "hello " <+> x | |
perverse {a = _} x = x | |
main : IO () | |
main = do | |
printLn $ perverse 5 | |
printLn $ perverse "world" | |
printLn $ perverse True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment