{"action":"closed","issue":{"url":"https://api.github.com/repos/ramda/ramda-fantasy/issues/10","labels_url":"https://api.github.com/repos/ramda/ramda-fantasy/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/ramda/ramda-fantasy/issues/10/comments","events_url":"https://api.github.com/repos/ramda/ramda-fantasy/issues/10/events","html_url":"https://github.com/ramda/ramda-fantasy/issues/10","id":57004632,"number":10,"title":"\"Abstract\" types","user":{"login":"TheLudd","id":557295,"avatar_url":"https://avatars.githubusercontent.com/u/557295?v=3","gravatar_id":"","url":"https://api.github.com/users/TheLudd","html_url":"https://github.com/TheLudd","followers_url":"https://api.github.com/users/TheLudd/followers","following_url":"https://api.github.com/users/TheLudd/following{/other_user}","gists_url":"https://api.github.com/users/TheLudd/gists{/gist_id}","starred_url":"https://api.github.com/users/TheLudd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheLudd/subscriptions","organizations_url":"https://api.github.com/users/TheLudd/orgs","repos_url":"https://api.github.com/users/TheLudd/repos","events_url":"https://api.github.com/users/TheLudd/events{/privacy}","received_events_url":"https://api.github.com/users/TheLudd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-09T09:07:44Z","updated_at":"2015-03-29T21:19:14Z","closed_at":"2015-03-29T21:19:14Z","body":"From the fantasy-land [Monad](https://github.com/fantasyland/fantasy-land#monad) specification.\r\n\r\n > A value which satisfies the specification of a Monad does not need to implement:\r\n\r\n>  * Apply's ap; derivable as function(m) { return this.chain(function(f) { return m.map(f); }); }\r\n * Functor's map; derivable as function(f) { var m = this; return m.chain(function(a) { return m.of(f(a)); })}\r\n\r\nThis could mean that we could create this type:\r\n ```\r\nfunction Monad() {}\r\nMonad.prototype.ap = function(m) { return this.chain(function(f) { return m.map(f); }); }\r\nMonad.prototype.map = function(f) { var m = this; return m.chain(function(a) { return m.of(f(a)); })}\r\n```\r\n\r\n.. and then implement stuff like\r\n```\r\nfunction Maybe() {};\r\ninherits(Maybe, Monad);\r\n\r\nfunction Just() {};\r\ninherits(Just, Maybe);\r\n\r\nJust.prototype.of = ...\r\nJust.prototype.chain = ...\r\n```\r\n\r\nThis also removes the need to test if the type has all the monadic functions. All that is required is to assert it is an instance of ```Monad```.\r\n\r\nThere are also other examples of functions that can be derived from other types.\r\nGood/bad idea? "}}