Open dakom opened 5 years ago
New api proposal
const pi = def('myVar')([])($.IntegerType)(3.14)
Both the pure function suggested by @dakom and the assertion suggested by @FranzSkuffka are good ideas! I would like to provide both, as they have different use cases.
Type
.validate is a useful tool for both getting type validation as an Either, and getting more detailed info about where an error occuredWould be great to have it documented on the public Readme(s) - and to have it exported as a function on
sanctuary-def
via$.validate()
:)I'd imagine the signature would be something like:
Not sure what ErrorMessage is though