Created
November 13, 2020 21:11
-
-
Save bond15/4fe90162bacf4c54817e207c0e45e67a 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
data Maybe a = None | Some a | |
class Monad f where | |
return :: a -> f a | |
bind :: f a -> (a -> f b) -> f b | |
instance Monad Maybe where | |
return x = Some x | |
bind None f = None | |
bind (Some x) f = f x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment