Skip to content

Instantly share code, notes, and snippets.

@JustinSDK
Created February 15, 2015 00:55
Show Gist options
  • Save JustinSDK/12ee1bcca7cd3ca5fc6a to your computer and use it in GitHub Desktop.
Save JustinSDK/12ee1bcca7cd3ca5fc6a to your computer and use it in GitHub Desktop.
〈Haskell Tutorial(25)可映射盒中物行為的 Functor〉的解答
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