Skip to content

Instantly share code, notes, and snippets.

@NicolasT
Created May 15, 2010 14:26
Show Gist options
  • Save NicolasT/402215 to your computer and use it in GitHub Desktop.
Save NicolasT/402215 to your computer and use it in GitHub Desktop.
f :: Monad m => m Int -> m Bool
f a = do
b <- a
return $ b == 0
main :: IO ()
main = do
dump $ Just 10
dump $ Just 0
dump Nothing
dump []
dump [-2, -1 .. 2]
where
dump :: (Monad m, Show (m Bool), Show (m Int)) => m Int -> IO ()
dump a = putStrLn ("f(" ++ show a ++ "): " ++ show (f a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment