Replies: 1 comment
-
wrong repo |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
there are situations, where enum want to be used not as an complex ADT:
but rather as a simple enum, where variants don't have any arguments:
It would be handy if one can derive type class for
enum
that is compile time ensured to be simple:in this case
SimpleSumDerivation
doesn't need a join method, since we excludeProduct
and the compiler should not be able to find or construct given forShow[Complex]
What I want to achieve with this idea:
Product
related logic, when they only want to derive type class for simpleenum
summon[Show[Complex]]
when the type class implementation is not intended for complex enumsIs it even possible, I would imagine we will need to implement some sort of compile time constraint in a form of
IsSimpleSum[T: SumReflection]
?What do you think about this idea?
Beta Was this translation helpful? Give feedback.
All reactions