phadej / typify

Runtime type checking for JavaScript
BSD 3-Clause "New" or "Revised" License
76 stars 7 forks source link

Higher-order function type checks #8

Open phadej opened 11 years ago

phadej commented 11 years ago

Would be nice to have eg.

var sortByMetric = typify("sortByMetric :: (* -> number) -> array * -> array *", function (metric, arr) {
  // sort...
});

This can be done by typifying function parameters with (* -> number) before applying the function.

This will need change to grammar, checkableType can then contain functionTypes.

phadej commented 11 years ago

Check