-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate Enum instances for enumerations #179
Comments
This is easy to add, although the mapping to integers will not necessarily match the field numbers. Note that we currently provide a https://hackage.haskell.org/package/proto3-wire-1.2.1/docs/Proto3-Wire-Class.html#t:ProtoEnum However, I'm guessing that if you're requesting this that you have a use case where you just need to map them onto a contiguous range of numbers? |
Right, being able to enumerate the set of fields for an enumeration would be convenient, e.g. [minBound @MyEnumeration .. maxBound @MyEnumeration] |
Although, it seems like the |
Would the Alternatively, would it make sense to extend type class |
Protocol buffer enumerations are not generated with
Enum
instances. They are generated with instances toBounded
andOrd
, so there shouldn't be anything preventingEnum
from also being provided by default.The text was updated successfully, but these errors were encountered: