Created
February 17, 2017 21:23
-
-
Save ctford/45f54a3c4c076f3515f0f2f1db00430b to your computer and use it in GitHub Desktop.
A safe test that returns different types in the if and the else branches.
This file contains hidden or 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
when : (test : Bool) -> a -> b -> if test then a else b | |
when True x _ = x | |
when False _ y = y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment