Comments (7)
Bear in mind that the right-associative arrow does make sense where currying is actually going on. So Char -> Char -> Char
would be the appropriate signature for
//+ char_first :: Char -> Char -> Char
function char_first(c1){
return function(c2) {
return c1;
}
}
(I'm Jameshfisher :)
from typedjs.
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.
from typedjs.
I can't remember the Haskell equivalent exactly, but I think it would be //+ char_first :: Char Char -> Char
. Another option, if the delimiter is necessary, might be //+ char_first :: Char * Char -> Char
, a la ML.
from typedjs.
//+ add :: Number, Number -> Number
currently works.
from typedjs.
Nice!
from typedjs.
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]
from typedjs.
No, currying doesn't work :(
from typedjs.
Related Issues (15)
- Javascript should be JavaScript HOT 1
- Contracts rather than Types HOT 2
- Objects: Enforce types on properties mentioned HOT 1
- object names that include numbers generate parse errors
- Confusing syntax: addTest/go
- use java doc syntax HOT 3
- Issue in test.js - function name HOT 2
- run_tests_on_string inconsistent return type/value
- Issue in test.js - add_all() HOT 2
- jQuery required? HOT 2
- jison grammar HOT 1
- License choice HOT 2
- Char isn't a JavaScript type HOT 2
- Does not work with functions not in global scope HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typedjs.