Algebra package in Haskell