-
-
Save dmjio/b834954af8ff98a1bf04242d8d5a5b8c 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
instance Functor Maybe where | |
fmap :: (a -> b) -> Maybe a -> Maybe b | |
fmap (_ :: a -> b) (Nothing :: Maybe a) = Nothing :: Maybe b | |
fmap (f :: a -> b) (Just x :: Maybe a) = Just ((f :: a -> b) (x :: a) :: b) :: Maybe b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment