Skip to content

Instantly share code, notes, and snippets.

@chris-martin
Last active January 16, 2018 14:53
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 chris-martin/bd317fc799676eed37c5553b8f13e247 to your computer and use it in GitHub Desktop.
Save chris-martin/bd317fc799676eed37c5553b8f13e247 to your computer and use it in GitHub Desktop.
{-# 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