symmetric-properties-0.1.0.0: Monoids for sameness and uniqueness.

Safe HaskellSafe
LanguageHaskell2010

Data.Monoid.Same

Description

Monoidal witness that all items in a bag are the same.

Synopsis

Documentation

data Same a Source #

Monoid under every element being equal.

Constructors

DegenerateSame

Witness that all of no items are equal

NotSame a a

Witness that two items are not equal

Same a

Witness of item that everything is equal to

Instances

Eq a => Eq (Same a) Source # 

Methods

(==) :: Same a -> Same a -> Bool #

(/=) :: Same a -> Same a -> Bool #

Ord a => Ord (Same a) Source # 

Methods

compare :: Same a -> Same a -> Ordering #

(<) :: Same a -> Same a -> Bool #

(<=) :: Same a -> Same a -> Bool #

(>) :: Same a -> Same a -> Bool #

(>=) :: Same a -> Same a -> Bool #

max :: Same a -> Same a -> Same a #

min :: Same a -> Same a -> Same a #

Show a => Show (Same a) Source # 

Methods

showsPrec :: Int -> Same a -> ShowS #

show :: Same a -> String #

showList :: [Same a] -> ShowS #

Eq a => Monoid (Same a) Source # 

Methods

mempty :: Same a #

mappend :: Same a -> Same a -> Same a #

mconcat :: [Same a] -> Same a #

allSame :: (Eq a, Foldable f) => f a -> Same a Source #

What is every element of this foldable?

allSame_ :: (Eq a, Foldable f) => f a -> Bool Source #

Is every element of this foldable equal?