fogus/lemonad — pull request #11 by mattneary (2013-09-26 23:41:38+00:00)
Title: Friendly Type Checking

This is a basic version of something we discussed on Twitter, intended as one solution to type checking. The basic usage is of the following form.

```javascript
var strictFun = L.typed(fun, String, [Number]);
strictFun("", [1]);
// => fun("", [1]);
strictFun(0, [1])
// => Error: Expected argument at index 0 to be of type String.
```

Currently, it simply supports strings, numbers, and dictionaries or arrays of the supported types. Of course, checking of function types will be our main obstacle down the road; however, a simple extension of `L.typed` to include return type and its checking would allow `L.typed` constructed functions to be composed in a type-checked manner.