{"action":"created","issue":{"url":"https://api.github.com/repos/fnpy/fn.py/issues/7","repository_url":"https://api.github.com/repos/fnpy/fn.py","labels_url":"https://api.github.com/repos/fnpy/fn.py/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/fnpy/fn.py/issues/7/comments","events_url":"https://api.github.com/repos/fnpy/fn.py/issues/7/events","html_url":"https://github.com/fnpy/fn.py/issues/7","id":142056774,"number":7,"title":"Should _ fail with ArityError, or return a curried function?","user":{"login":"low-ghost","id":9889378,"avatar_url":"https://avatars.githubusercontent.com/u/9889378?v=3","gravatar_id":"","url":"https://api.github.com/users/low-ghost","html_url":"https://github.com/low-ghost","followers_url":"https://api.github.com/users/low-ghost/followers","following_url":"https://api.github.com/users/low-ghost/following{/other_user}","gists_url":"https://api.github.com/users/low-ghost/gists{/gist_id}","starred_url":"https://api.github.com/users/low-ghost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/low-ghost/subscriptions","organizations_url":"https://api.github.com/users/low-ghost/orgs","repos_url":"https://api.github.com/users/low-ghost/repos","events_url":"https://api.github.com/users/low-ghost/events{/privacy}","received_events_url":"https://api.github.com/users/low-ghost/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-19T12:23:07Z","updated_at":"2016-03-20T02:05:01Z","closed_at":null,"body":"Improperly handling arity can be a hard to track down source of error, especially when composing functions, but I would want `(_ + _)(2)` to return a function that looked like `\"(x1) => (2 + x1)\"` such that `(_ + _)(2, 3)` and `(_ + _)(2)(3)` would be equivalent and both result in `5`.\r\n\r\nI can understand the intent of the TypeError and it could actually be the best approach to ease problems dealing with composition and with standard python functions, e.g.\r\n```python\r\nlist(filter(_ < _, [9,10,11]))\r\n```\r\nwould be problematic. However, it might be worth considering the curried behavior."},"comment":{"url":"https://api.github.com/repos/fnpy/fn.py/issues/comments/198827326","html_url":"https://github.com/fnpy/fn.py/issues/7#issuecomment-198827326","issue_url":"https://api.github.com/repos/fnpy/fn.py/issues/7","id":198827326,"user":{"login":"jacobbridges","id":8033168,"avatar_url":"https://avatars.githubusercontent.com/u/8033168?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobbridges","html_url":"https://github.com/jacobbridges","followers_url":"https://api.github.com/users/jacobbridges/followers","following_url":"https://api.github.com/users/jacobbridges/following{/other_user}","gists_url":"https://api.github.com/users/jacobbridges/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobbridges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobbridges/subscriptions","organizations_url":"https://api.github.com/users/jacobbridges/orgs","repos_url":"https://api.github.com/users/jacobbridges/repos","events_url":"https://api.github.com/users/jacobbridges/events{/privacy}","received_events_url":"https://api.github.com/users/jacobbridges/received_events","type":"User","site_admin":false},"created_at":"2016-03-20T02:05:01Z","updated_at":"2016-03-20T02:05:01Z","body":"What do you think of adding a \"curried\" submodule to fn.py? Example:\r\n\r\n```\r\nfrom fn.curried import _\r\n\r\nf = (_ + _)\r\nf2 = f(2)\r\nx = f2(3)\r\nx == 5\r\n```\r\n\r\nAnd when importing from the normal module, it produces an `ArityError`:\r\n\r\n```\r\nfrom fn import _\r\n\r\nf = (_ + _)\r\nf2 = f(2)\r\n\r\nArityError: (_ + _) expected 2 arguments, got 1\r\n```"}}