{"action":"created","issue":{"url":"https://api.github.com/repos/jOOQ/jOOL/issues/87","labels_url":"https://api.github.com/repos/jOOQ/jOOL/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOL/issues/87/comments","events_url":"https://api.github.com/repos/jOOQ/jOOL/issues/87/events","html_url":"https://github.com/jOOQ/jOOL/issues/87","id":68811143,"number":87,"title":"Function Currying","user":{"login":"LordBlackhole","id":5004855,"avatar_url":"https://avatars.githubusercontent.com/u/5004855?v=3","gravatar_id":"","url":"https://api.github.com/users/LordBlackhole","html_url":"https://github.com/LordBlackhole","followers_url":"https://api.github.com/users/LordBlackhole/followers","following_url":"https://api.github.com/users/LordBlackhole/following{/other_user}","gists_url":"https://api.github.com/users/LordBlackhole/gists{/gist_id}","starred_url":"https://api.github.com/users/LordBlackhole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LordBlackhole/subscriptions","organizations_url":"https://api.github.com/users/LordBlackhole/orgs","repos_url":"https://api.github.com/users/LordBlackhole/repos","events_url":"https://api.github.com/users/LordBlackhole/events{/privacy}","received_events_url":"https://api.github.com/users/LordBlackhole/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jOOQ/jOOL/labels/P:%20Medium","name":"P: Medium","color":"ffaaaa"},{"url":"https://api.github.com/repos/jOOQ/jOOL/labels/T:%20Enhancement","name":"T: Enhancement","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jOOQ/jOOL/milestones/5","html_url":"https://github.com/jOOQ/jOOL/milestones/Version%200.9.7","labels_url":"https://api.github.com/repos/jOOQ/jOOL/milestones/5/labels","id":960160,"number":5,"title":"Version 0.9.7","description":"","creator":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":7,"state":"open","created_at":"2015-02-01T12:46:09Z","updated_at":"2015-04-16T15:15:44Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-04-15T23:42:51Z","updated_at":"2015-04-16T16:02:52Z","closed_at":null,"body":"**-Enhancment**\r\n\r\nSomething I've been finding myself doing quite a bit recently is writing extra lambdas for currying my functions. Turning Functions into Suppliers and BiFunctions into Functions by partially applying the first argument. I was writing some static helper methods for simplifying this when I realized that it would be a lot easier and make more sense to just have those methods on the Function interfaces themselves. \r\n\r\nSo for example, Function2 would have ....\r\n\r\n```java\r\ndefault Function1<T2, R> curry(T1 v1) {\r\n    return v2 -> apply(v1, v2);\r\n}\r\n\r\ndefault Function0<R> curry(T1 v1, T2 v2){\r\n    return () -> apply(v1, v2)\r\n}\r\n```\r\n\r\nWhile not *technically* the proper definition of Currying, which would require having only one method returning `Function<T1, Function<T2, R>>`, I feel like this would produce code that would be easier to read and more familiar to a Java developer. For example if you had a Function4 and wanted to apply the first three arguments, it'd be a simple matter of `func.curry(var1, var2, var3)` instead of `func.curry().apply(var1).apply(var2).apply(var3)`\r\n\r\nI'm really liking this library and I would be happy to write up the boiler-plate for this and make a pull request. I just wanted to know if there would be any interest in it. "},"comment":{"url":"https://api.github.com/repos/jOOQ/jOOL/issues/comments/93772527","html_url":"https://github.com/jOOQ/jOOL/issues/87#issuecomment-93772527","issue_url":"https://api.github.com/repos/jOOQ/jOOL/issues/87","id":93772527,"user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T16:02:52Z","updated_at":"2015-04-16T16:02:52Z","body":"@danieldietrich Stealing the idea and a couple of users at the same time? Sneaky! ;)"}}