-
-
Save kindlychung/bf4003104dbc28ac548b to your computer and use it in GitHub Desktop.
learn you a haskell
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
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c | |
f `on` g = \x y -> f (g x) (g y) |
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
instance Functor (Either a) where | |
fmap f (Right x) = Right (f x) | |
fmap f (Left x) = Left x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment