-
Notifications
You must be signed in to change notification settings - Fork 8
Description
As far as I understand, currently, when I use e.g. intCast incorrectly, I will get Couldn't match type ‘'False’ with ‘'True’ error. It may be not immediately obvious that the conversion method is used incorrectly, and the types between which we convert are not mentioned here so understanding the cause of the failure may take a bit of extra time.
I propose using TypeError to provide better error messages. For instance, it is possible to define some CheckIntSubType wrapper over IsIntSubType that would report Cannot convert a to b error on failure, and then conversion methods can use these Check* constraints instead of ~ 'True.
I'm really happy that I finally found this library, and to me it looks like the most proper solution to the problem; hope it could be polished to final bits of perfection. 🙂