algebraic groups in haskell