Skip to content

Instantly share code, notes, and snippets.

@dmjio
Created April 2, 2021 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmjio/b834954af8ff98a1bf04242d8d5a5b8c to your computer and use it in GitHub Desktop.
Save dmjio/b834954af8ff98a1bf04242d8d5a5b8c to your computer and use it in GitHub Desktop.
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