symmetric-properties-0.1.0.1: 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 # 
Instance details

Defined in Data.Monoid.Same

Methods

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

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

Ord a => Ord (Same a) Source # 
Instance details

Defined in Data.Monoid.Same

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 # 
Instance details

Defined in Data.Monoid.Same

Methods

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

show :: Same a -> String #

showList :: [Same a] -> ShowS #

Eq a => Semigroup (Same a) Source # 
Instance details

Defined in Data.Monoid.Same

Methods

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

sconcat :: NonEmpty (Same a) -> Same a #

stimes :: Integral b => b -> Same a -> Same a #

Eq a => Monoid (Same a) Source # 
Instance details

Defined in Data.Monoid.Same

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?