Last active
December 22, 2015 15:48
-
-
Save myme/6494685 to your computer and use it in GitHub Desktop.
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
fromMaybe :: Maybe a -> String | |
fromMaybe Nothing = "Nothing" | |
fromMaybe Just a = show a |
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
foo :: [Maybe Int] | |
foo = [ Just 10 | |
, Just 20 | |
, Nothing | |
, Just 40 | |
] | |
main :: IO () | |
main = mapM_ (putStrLn ∘ show) foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment