Closed
Description
This might seem a bit backward, but I'll start this proposal with the finite cyclic groups. They seem to be the more useful ones, because they give you principled conversion from Int
.
class (Cyclic g, BoundedEnum g) <= FiniteCyclic g where
fromInt :: Int -> g
The Cyclic
superclass gives us:
class (Group g) <= CyclicGroup g where
generator :: g
You can define a defaultFromInt
that uses the generator
.
The most immediate problem I see this resolving is that BoundedEnum
's fromInt
has a Maybe
, and no sensible default implementation.
Curious for others' thoughts.
Metadata
Metadata
Assignees
Labels
No labels