Last active
December 14, 2015 10:16
-
-
Save nagat01/82ec16e1009e25f11178 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
-- monad laws | |
(>>= f) . return = f | |
(>>= return) = id | |
(>>= g) . (>>= f) = (>>= ((>>= g) . f)) | |
-- definitions | |
fmap f = (>>= (return . f)) | |
join = (>>= id) | |
-- theorem | |
join . fmap return | |
= (>>= id) . (>>= (return . return)) | |
= (>>= ((>>= id) . (return . return))) | |
= (>>= (((>>= id) . return) . return)) | |
= (>>= (id . return)) | |
= (>>= return) | |
= id | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment