-
-
Save theqp/9a450ffdc6dbb3de77a275c8debfb1eb 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
fold :: b -> (a -> b) -> Maybe a -> b | |
fold nothing just = \case | |
Nothing -> nothing | |
Just a -> just a | |
fold :: (a -> c) -> (b -> c) -> Either a b -> c | |
fold l r = \case | |
Left a -> l a | |
Right b -> r b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment