{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.Ring
    ( module Data.Group
    , module Data.Ring.Semi
    ) where

import Data.Group
import Data.Ring.Semi

class (Group a, Semiring a) => Ring a

-- todo: the Boolean Ring (with symmetric difference as addition)
-- use Data.Ring.Semi.Ord.Order Bool to get the and/or based Boolean distribuive lattice semiring

instance Monoid Bool where
    mempty = False
    a `mappend` b = (a || b) && not (a && b)

instance Group Bool where
    gnegate = not

instance MultiplicativeMonoid Bool where
    one = True
    times = (&&)

instance Seminearring Bool
instance Semiring Bool
instance Ring Bool