Last active
August 29, 2015 14:02
-
-
Save DimaD/06fa2284e9d8a90442f8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Prelude> :m Control.Monad | |
Prelude Control.Monad> join (,) 1 | |
(1,1) | |
-- So it produces pairs somehow. Let's look at type signatures | |
Prelude Control.Monad> :t join | |
join :: Monad m => m (m a) -> m a | |
Prelude Control.Monad> :t (,) | |
(,) :: a -> b -> (a, b) | |
Prelude Control.Monad> :t join (,) | |
join (,) :: a -> (a, a) | |
-- Does not make any sense by looking at this. | |
-- Explanation of how type checker deduces what to do by Edward Kmett is here: | |
-- http://www.reddit.com/r/haskell/comments/1olk04/the_magic_of_join/cct4kaz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment