This repository was archived by the owner on Oct 15, 2025. It is now read-only.
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
Uh oh!
There was an error while loading. Please reload this page.
-
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
enumthat is compile time ensured to be simple:in this case
SimpleSumDerivationdoesn't need a join method, since we excludeProductand the compiler should not be able to find or construct given forShow[Complex]What I want to achieve with this idea:
Productrelated logic, when they only want to derive type class for simpleenumsummon[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