{"action":"opened","issue":{"url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/169","labels_url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/169/comments","events_url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/169/events","html_url":"https://github.com/MostlyAdequate/mostly-adequate-guide/issues/169","id":106308730,"number":169,"title":"Bind","user":{"login":"onmyway133","id":2284279,"avatar_url":"https://avatars.githubusercontent.com/u/2284279?v=3","gravatar_id":"","url":"https://api.github.com/users/onmyway133","html_url":"https://github.com/onmyway133","followers_url":"https://api.github.com/users/onmyway133/followers","following_url":"https://api.github.com/users/onmyway133/following{/other_user}","gists_url":"https://api.github.com/users/onmyway133/gists{/gist_id}","starred_url":"https://api.github.com/users/onmyway133/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onmyway133/subscriptions","organizations_url":"https://api.github.com/users/onmyway133/orgs","repos_url":"https://api.github.com/users/onmyway133/repos","events_url":"https://api.github.com/users/onmyway133/events{/privacy}","received_events_url":"https://api.github.com/users/onmyway133/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-14T09:54:50Z","updated_at":"2015-09-14T09:54:50Z","closed_at":null,"body":"Hi, In [chapter 9, section My chain hits my chest](http://drboolean.gitbooks.io/mostly-adequate-guide/content/ch9.html)\r\n\r\n> You might have noticed a pattern. We often end up calling join right after a map. Let's abstract this into a function called chain.\r\n\r\n```\r\n//  chain :: Monad m => (a -> m b) -> m a -> m b\r\nvar chain = curry(function(f, m){\r\n  return m.map(f).join(); // or compose(join, map(f))(m)\r\n});\r\n```\r\n\r\nThis make good encapsulation because we hide the `__value` inside monad, but I often see `bind` explained like this\r\n```\r\nvar chain = curry(function(f, m){\r\n  return f(m.__value);\r\n});\r\n```\r\n\r\nWhat should be the preferred way?\r\n"}}