News for hackers. Stuff that matters.
Re:Type Checking in JavaScript by mneary on Wednesday November 06, 2013 @08:13AM (#6682485)
With Typical[1], I took a different approach enforcing types on the functions.

[1]: https://github.com/mattneary/Typical

Re:Type Checking in JavaScript by rimo on Wednesday November 06, 2013 @08:22AM (#6682521)
The approach is interesting but the syntax makes it hard to use. Why not make the first arguments the types like one would expect?
Re:Type Checking in JavaScript by mneary on Wednesday November 06, 2013 @09:36AM (#6682849)
I went back and forth with that. I think I went with postfix because there exists another syntax which looks prefix:

    T([Number, Number])(function(x) { return x; })
For this method, a function type is defined and then serves as a constructor that accepts a function as argument.