Algebraic structures represented using haskell typeclasses.