-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading Use of Currying in Type Signatures #12
Comments
Bear in mind that the right-associative arrow does make sense where currying is actually going on. So //+ char_first :: Char -> Char -> Char
function char_first(c1){
return function(c2) {
return c1;
}
} (I'm Jameshfisher :) |
Right. But knowing whether a function can be curried (like your example) requires a bit of analysis that I'm not currently doing ;-) Maybe an extra feature later on. |
I can't remember the Haskell equivalent exactly, but I think it would be |
|
Nice! |
Love the principle of TypedJS but having some problems using it so, with apologies if I'm being a "DA".... Does currying work? I tried a simple function: fnCurry = function (a) { return function (b) { return true; } }; and then used test = TypedJS.addTest("fnCurry :: Number -> Number -> Boolean", fnCurry);
TypedJS.go([test]); but it fails 300 times with Expected "boolean" but returned undefined on input: [62,33] |
No, currying doesn't work :( |
Jameshfisher of reddit made a good point:
http://www.reddit.com/r/javascript/comments/pholi/typedjs_sanity_check_your_code/c3pscxo
The text was updated successfully, but these errors were encountered: