{"action":"created","issue":{"url":"https://api.github.com/repos/stoeffel/1-liners/issues/44","labels_url":"https://api.github.com/repos/stoeffel/1-liners/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/stoeffel/1-liners/issues/44/comments","events_url":"https://api.github.com/repos/stoeffel/1-liners/issues/44/events","html_url":"https://github.com/stoeffel/1-liners/issues/44","id":73231982,"number":44,"title":"Idea: have only one simple curry function","user":{"login":"tomekwi","id":4624660,"avatar_url":"https://avatars.githubusercontent.com/u/4624660?v=3","gravatar_id":"","url":"https://api.github.com/users/tomekwi","html_url":"https://github.com/tomekwi","followers_url":"https://api.github.com/users/tomekwi/followers","following_url":"https://api.github.com/users/tomekwi/following{/other_user}","gists_url":"https://api.github.com/users/tomekwi/gists{/gist_id}","starred_url":"https://api.github.com/users/tomekwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomekwi/subscriptions","organizations_url":"https://api.github.com/users/tomekwi/orgs","repos_url":"https://api.github.com/users/tomekwi/repos","events_url":"https://api.github.com/users/tomekwi/events{/privacy}","received_events_url":"https://api.github.com/users/tomekwi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/stoeffel/1-liners/milestones/1","html_url":"https://github.com/stoeffel/1-liners/milestones/1.0.0","labels_url":"https://api.github.com/repos/stoeffel/1-liners/milestones/1/labels","id":1096768,"number":1,"title":"1.0.0","description":"","creator":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":0,"state":"open","created_at":"2015-05-05T12:13:56Z","updated_at":"2015-05-05T12:28:54Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-05-05T07:11:06Z","updated_at":"2015-05-05T12:42:28Z","closed_at":null,"body":"```js\r\nimport curry from '1-liners/curry2';\r\n\r\nconst f = (a, b, c, d) => a * b - c * d + e;\r\nconst fβ = curry(f)                       // ~= curry2       \r\nconst fγ = curry(curry(f))                // ~= curry3                \r\nconst fδ = curry(curry(curry(f)))         // ~= curry4                           \r\nconst fε = curry(curry(curry(curry(f))))  // ~= curry5\r\n\r\nf(1, 2, 3, 4, 5)  === -5\r\n\r\nfβ(1)(2, 3, 4, 5) === -5\r\nfβ(1, 2)(3, 4, 5) === -5\r\nfβ(1, 2, 3)(4, 5) === -5\r\nfβ(1, 2, 3, 4)(5) === -5\r\n\r\nfγ(1)(2)(3, 4, 5) === -5\r\nfγ(1)(2, 3)(4, 5) === -5\r\nfγ(1, 2)(3, 4)(5) === -5\r\n\r\nfδ(1)(2)(3)(4, 5) === -5\r\nfδ(1)(2)(3, 4)(5) === -5\r\nfδ(1)(2, 3)(4)(5) === -5\r\nfδ(1, 2)(3)(4)(5) === -5\r\n\r\nfε(1)(2)(3)(4)(5) === -5\r\n```\r\n\r\nLet’s just leave `curry2` and name it `curry`.\r\n\r\nLess is more."},"comment":{"url":"https://api.github.com/repos/stoeffel/1-liners/issues/comments/99067818","html_url":"https://github.com/stoeffel/1-liners/issues/44#issuecomment-99067818","issue_url":"https://api.github.com/repos/stoeffel/1-liners/issues/44","id":99067818,"user":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T12:42:28Z","updated_at":"2015-05-05T12:42:28Z","body":"Or one could use `compose` and `reduce`.\r\n\r\n```js\r\nimport curry from '1-liners/curry2';\r\nimport reduce from '1-liners/reduce';\r\nimport compose from '1-liners/compose';\r\n\r\nconst curry3 = compose(curry, curry);\r\nconst curry4 = reduce(compose, [curry, curry, curry]);\r\n\r\nconst f = (a, b, c, d) => a * b * c * d;\r\nconst fβ = curry(f)                       // ~= curry2       \r\nconst fγ = curry3(f)                // ~= curry3\r\nconst fδ = curry4(f)                // ~= curry4\r\n\r\nf(1, 2, 3, 4)  === 24\r\n\r\nfβ(1)(2, 3, 4) === 24\r\nfβ(1, 2)(3, 4) === 24\r\nfβ(1, 2, 3)(4) === 24\r\n\r\nfγ(1)(2)(3, 4) === 24\r\nfγ(1)(2, 3)(4) === 24\r\n\r\nfδ(1)(2)(3)(4) === 24\r\n```"}}