Skip to content

Instantly share code, notes, and snippets.

@chuwy
Last active March 16, 2020 11:44
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 chuwy/d518efcdc2d5ac9d70fbe1636167891a to your computer and use it in GitHub Desktop.
Save chuwy/d518efcdc2d5ac9d70fbe1636167891a to your computer and use it in GitHub Desktop.
data Option a where
Some : a -> Option a
None : Option a
instance Functor
fmap : (a -> b) -> Option a -> Option b
fmap f (Some a) = Some (f a)
fmap _ None = None
deriving instance Show given Show a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment