Last active
January 16, 2018 14:53
-
-
Save chris-martin/bd317fc799676eed37c5553b8f13e247 to your computer and use it in GitHub Desktop.
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
{-# LANGUAGE LambdaCase2 #-} | |
intToBool :: Int -> Maybe Bool | |
boolToInt :: Bool -> Int | |
(boolToInt, intToBool) = | |
\case2 | |
False -> 0 | |
True -> 1 | |
data YN = Yes | No | |
ynToBool :: YN -> Bool | |
boolToYN :: Bool -> YN | |
(ynToBool, boolToYN) = | |
\case2 | |
No <-> False | |
Yes <-> True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment