add Enum instance for Char, fix all versions#3
Conversation
|
Wouldn't it be better to put this in |
|
Code looks good though. |
|
It depends on which one you thing is more "core", right? If we added character literals at some point (e.g. 'A'), then that data type would go in Prelude, so the instance would go here and the dependency on strings dropped. That's why I added it here: I view 'Data.Char' as being more "core" than Data.Enum. Indeed, many more projects import purescript-strings that import purescript-enums. So if we swap the dependency, then anyone who pulls in strings will also get enums. Still, happy to switch it, the above was just my reasoning at the time. Let me know. |
|
I guess I was thinking of quickcheck where class modules depend on instance modules. |
|
In Quickcheck, the class Arbitrary is implemented for all core types (Char, Number, String, etc.). In a similar fashion, in Enums, the class Enu�m is implemented for all core types which are Enums (Tuple, Char, Boolean, etc.). Right? |
|
Yes, that makes sense. |
add Enum instance for Char, fix all versions
This is fully backward compatible, albeit with one caveat: it adds a dependency on the latest version of purescript-strings, so could potentially introduce a conflict if released under a patch fix update (albeit, only in the case a user of the library is not compatible with the latest purescript-strings and has opted not to fix patch version for their dependency on purescript-enums).
The current version is
0.2.1, so this could be0.2.2under a patch fix update, or0.3.0otherwise.