Created
August 22, 2015 22:24
-
-
Save manpages/03146e22ff5ada23f5be to your computer and use it in GitHub Desktop.
Nullable is clearly at least a functor
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
fmapNullable :: forall a b. (a -> b) -> (Nullable a) -> (Nullable b) | |
fmapNullable f x = g f $ toMaybe x | |
where | |
g f Nothing = toNullable Nothing | |
g f (Just v) = toNullable $ Just (f v) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment