{-# LANGUAGE CPP #-}
#if MIN_VERSION_base(4,12,0)
{-# LANGUAGE TypeOperators #-}
#endif
module Data.Semigroup.Commutative where
import Data.IntSet (IntSet)
import Data.Monoid
import Data.Ord
import Data.List (unfoldr)
import Data.Set
#if MIN_VERSION_base(4,7,0)
import Data.Proxy
#endif
#if MIN_VERSION_base(4,8,0)
import Data.Void (Void)
#endif
#if MIN_VERSION_base(4,9,0) && !MIN_VERSION_base(4,11,0)
import Data.Semigroup (Semigroup(..))
#endif
#if MIN_VERSION_base(4,9,0)
import Data.Functor.Const
import Data.Functor.Identity
import Data.Semigroup (Max, Min, WrappedMonoid)
#endif
#if MIN_VERSION_base(4,12,0)
import Data.Functor.Contravariant (Op(Op))
import GHC.Generics
#endif
import Numeric.Product.Commutative ( CommutativeProduct )
class
#if MIN_VERSION_base(4,9,0)
Semigroup g
#else
Monoid g
#endif
=> Commutative g
instance Commutative ()
instance Commutative All
instance Commutative Any
#if MIN_VERSION_base(4,8,0)
instance Commutative Void
#endif
#if MIN_VERSION_base(4,9,0)
instance Ord a => Commutative (Max a)
instance Ord a => Commutative (Min a)
instance (Commutative a, Monoid a) => Commutative (WrappedMonoid a)
#endif
instance Commutative a => Commutative (Maybe a)
instance Num a => Commutative (Sum a)
instance CommutativeProduct a => Commutative (Product a)
instance Commutative a => Commutative (Dual a)
instance Commutative b => Commutative (a -> b)
instance (Commutative a, Commutative b) => Commutative (a, b)
instance (Commutative a, Commutative b, Commutative c) => Commutative (a, b, c)
instance (Commutative a, Commutative b, Commutative c, Commutative d) => Commutative (a, b, c, d)
instance (Commutative a, Commutative b, Commutative c, Commutative d, Commutative e) => Commutative (a, b, c, d, e)
instance Ord a => Commutative (Set a)
instance Commutative IntSet
#if MIN_VERSION_base(4,11,0)
instance Commutative a => Commutative (Down a)
#endif
#if MIN_VERSION_base(4,7,0)
instance Commutative (Proxy x)
#endif
#if MIN_VERSION_base(4,9,0)
instance Commutative a => Commutative (Const a x)
instance Commutative a => Commutative (Identity a)
#endif
#if MIN_VERSION_base(4,12,0)
instance (Commutative (f a), Commutative (g a)) => Commutative ((f :*: g) a)
instance Commutative (f (g a)) => Commutative ((f :.: g) a)
instance Commutative a => Commutative (Op a b)
#endif