Skip to content

Instantly share code, notes, and snippets.

@jvranish
Created February 16, 2012 21:04
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 jvranish/1847835 to your computer and use it in GitHub Desktop.
Save jvranish/1847835 to your computer and use it in GitHub Desktop.
WordpressIsEatingMyHaskell
let result = do
account <- getAccount person
lastTransaction <- getLastTransaction account
getAmount lastTransaction
case result of
Nothing -> putStrLn "Oh noes!"
Just a -> putStrLn ("The amount was: " ++ show a)
-- Or really, I'd actually do this:
let result = getAmount =<< getLastTransaction =<< getAccount person
case result of
Nothing -> putStrLn "Oh noes!"
Just a -> putStrLn ("The amount was: " ++ show a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment