Skip to content

Instantly share code, notes, and snippets.

@Rembane
Last active December 31, 2015 06:19
Show Gist options
  • Save Rembane/7946384 to your computer and use it in GitHub Desktop.
Save Rembane/7946384 to your computer and use it in GitHub Desktop.
So, what happens when we wrap something in a monad? :D And what can we do with these endless possibilities?
{-# LANGUAGE NoMonomorphismRestriction #-}
-- If we aren't careful, the monomorphism restriction will bite our backs.
module Magic where
magic :: (Monad m) => Int -> Int -> m Int
magic a b = return $ a + b
main = magic 7 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment