7 ms·
> Another options besides comment-based annotations is property based annotations. Basically provide a library that contains all the possible primitive types th
by gcanti 12y ago
> Another options besides comment-based annotations is property based annotations.
Basically provide a library that contains all the possible primitive types that can be checked and functions for composing higher order types.
Shameless plug: I wrote a similar library based on set theory (I'm a mathematician)
https://github.com/gcanti/tcomb https://github.com/gcanti/tcomb
EDIT: and here an article explaining the rationale behind the library
https://gcanti.github.io/2014/09/29/javascript-types-and-sets.html https://gcanti.github.io/2014/09/29/javascript-types-and-set...