{"action":"created","issue":{"url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/161","labels_url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/161/comments","events_url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/161/events","html_url":"https://github.com/MostlyAdequate/mostly-adequate-guide/issues/161","id":105281372,"number":161,"title":"Examples in chapter 10 (in Laws)","user":{"login":"rpominov","id":825702,"avatar_url":"https://avatars.githubusercontent.com/u/825702?v=3","gravatar_id":"","url":"https://api.github.com/users/rpominov","html_url":"https://github.com/rpominov","followers_url":"https://api.github.com/users/rpominov/followers","following_url":"https://api.github.com/users/rpominov/following{/other_user}","gists_url":"https://api.github.com/users/rpominov/gists{/gist_id}","starred_url":"https://api.github.com/users/rpominov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpominov/subscriptions","organizations_url":"https://api.github.com/users/rpominov/orgs","repos_url":"https://api.github.com/users/rpominov/repos","events_url":"https://api.github.com/users/rpominov/events{/privacy}","received_events_url":"https://api.github.com/users/rpominov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-08T00:56:16Z","updated_at":"2015-10-01T20:40:19Z","closed_at":null,"body":"Hey, @DrBoolean! I just read chapter 10, it's great as always! Noticed couple of minor issues in examples.\r\n\r\n### # 1\r\n\r\nhttps://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch10.md#laws\r\n\r\n```js\r\nvar tOfM = compose(Task.of, Maybe.of);\r\nvar assemble = _.compose(_.concat, _.concat);\r\n\r\nliftA3(assemble, tOfM('Rainy Days'), tOfM(' and Mondays'), tOfM(' always get me down'));\r\n// Task(Maybe(Rainy Days and Mondays always get me down))\r\n```\r\n\r\nI think `assemble` should be defined as:\r\n```js\r\nvar assemble = liftA3(_.concat);\r\n```\r\n\r\n### # 2\r\n\r\nhttps://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch10.md#interchange\r\n\r\n```js\r\nvar v = Task.of(_.reverse);\r\nvar x = Task.of('Sparklehorse');\r\n\r\nv.ap(Task.of(x)) == Task.of(function(f) { return f(x) }).ap(v)\r\n```\r\n\r\nHere `var x = Task.of('Sparklehorse');` should be `var x = 'Sparklehorse';`."},"comment":{"url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/comments/144841754","html_url":"https://github.com/MostlyAdequate/mostly-adequate-guide/issues/161#issuecomment-144841754","issue_url":"https://api.github.com/repos/MostlyAdequate/mostly-adequate-guide/issues/161","id":144841754,"user":{"login":"salper","id":1014351,"avatar_url":"https://avatars.githubusercontent.com/u/1014351?v=3","gravatar_id":"","url":"https://api.github.com/users/salper","html_url":"https://github.com/salper","followers_url":"https://api.github.com/users/salper/followers","following_url":"https://api.github.com/users/salper/following{/other_user}","gists_url":"https://api.github.com/users/salper/gists{/gist_id}","starred_url":"https://api.github.com/users/salper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salper/subscriptions","organizations_url":"https://api.github.com/users/salper/orgs","repos_url":"https://api.github.com/users/salper/repos","events_url":"https://api.github.com/users/salper/events{/privacy}","received_events_url":"https://api.github.com/users/salper/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T20:40:19Z","updated_at":"2015-10-01T20:40:19Z","body":"The current definition for `#1` in chapter 10 is: \r\n```javascript\r\nvar tOfM = compose(Task.of, Maybe.of);\r\n\r\nliftA2(_.concat, tOfM('Rainy Days and Mondays'), tOfM(' always get me down'));\r\n// Task(Maybe(Rainy Days and Mondays always get me down))\r\n```\r\n\r\nBut using the book definition of `Maybe` and `data.task`, I can make it work using:\r\n```javascript\r\nconst tOfM = compose(Task.of, Maybe.of);\r\n\r\nconst concatMap = curry((m1, m2) => liftA2(concat, m1, m2));\r\n\r\nliftA2(concatMap, tOfM('Rainy Days and Mondays'), tOfM(' always get me down'))\r\n  .fork(err => log('err', err), data => log('success', data));\r\n// Task(Maybe(Rainy Days and Mondays always get me down))\r\n````\r\n\r\nAm I missing something ?"}}