Open futpib opened 6 years ago
Are you imagining something like the following?
> S.even.types.length
2
> S.even.types[0] === $.Integer
true
> S.even.types[1] === $.Boolean
true
Yes, or maybe via S.type
.
Actually, I can't imagine an f.types
-like API that could expose type constraints, so it must be more elaborate.
Maybe a way to get arguments that were passed to def
will do?
Looks good.
It seems that if this gets implemented, type classes could then check method signatures (at the moment they only seem to check if methods exist). Is this desirable?
I don't think type classes such as Z.Functor
should depend on Sanctuary-specific properties. sanctuary-type-classes is intended to interoperate with the wider Fantasy Land ecosystem.
This issue really belongs in the sanctuary-def issue tracker. Would you mind opening a new issue there, @futpib?
I think the function signature (as in
S.even.toString()
) should be accessible programmatically as a first-class thing (not a string), maybe behind a new option of$.create
.