Skip to content

Instantly share code, notes, and snippets.

@ctford
Created February 17, 2017 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctford/45f54a3c4c076f3515f0f2f1db00430b to your computer and use it in GitHub Desktop.
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.
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