Created
April 18, 2017 21:00
-
-
Save bohde/bdd90e96dbdfc6bfdcc693b8fc718d7a to your computer and use it in GitHub Desktop.
join for a hypothetical ziplist monad is the diagonal of the product
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
-- https://en.wikibooks.org/wiki/Haskell/Category_theory#The_second_law | |
join . fmap return = join . return = id | |
return = repeat | |
join . fmap repeat = join . repeat = id | |
-- let's try it on some arbitrary list | |
join [repeat a, repeat b, ...] = join (repeat [a, b, c, ...]) = [a, b, c, ...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment