I'm trying to define a type alias for words of group elements. More specifically, I have defined a group class as
class Group a where
identity :: a
inverse :: a -> a
(.*) :: a -> a -> a
and I want a type alias for a word in group elements where a word is a list of elements and exponents, something like
type (Group a) => Word = [(Group a, Int)]
This doesn't work. Is there some way to accomplish this in Haskell, or can you recommend another approach? Thanks!