Last active
August 29, 2015 14:04
-
-
Save munro/2fe9b017f5b12ad7fc12 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
import Control.Monad | |
import Control.Applicative | |
instance (Applicative f, Num a) => Num (f a) where | |
-- (+) <$> (return 123) <*> (return 321) now becomes: | |
-- ((return 123) + (return 321)) -- yipee! | |
(+) = liftA2 (+) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment