Implementation in Haskell of Semiring related concepts.