monoid-extras-0.4.0.0: Various extra monoid-related definitions and utilities

Copyright(c) 2012-2015 diagrams-core team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Monoid.Inf

Contents

Description

Make semigroups under min or max into monoids by adjoining an element corresponding to infinity (positive or negative, respectively). These types are similar to Option (Min a) and Option (Max a) respectively, except that the Ord instance matches the Monoid instance.

Synopsis

Documentation

data Inf p a Source

Constructors

Infinity 
Finite a 

Instances

Functor (Inf p) 
Foldable (Inf p) 
Traversable (Inf p) 
Eq a => Eq (Inf p a) 
(Data p, Data a) => Data (Inf p a) 
Ord a => Ord (Inf Neg a) 
Ord a => Ord (Inf Pos a) 
Read a => Read (Inf p a) 
Show a => Show (Inf p a) 
Ord a => Monoid (Inf Neg a) 
Ord a => Monoid (Inf Pos a) 
Ord a => Semigroup (Inf Neg a) 
Ord a => Semigroup (Inf Pos a) 
Typeable (* -> * -> *) Inf 

data Pos Source

Instances

Ord a => Ord (Inf Pos a) 
Ord a => Monoid (Inf Pos a) 
Ord a => Semigroup (Inf Pos a) 

data Neg Source

Instances

Ord a => Ord (Inf Neg a) 
Ord a => Monoid (Inf Neg a) 
Ord a => Semigroup (Inf Neg a) 

type PosInf a = Inf Pos a Source

type NegInf a = Inf Neg a Source

minimum :: Ord a => [a] -> PosInf a Source

maximum :: Ord a => [a] -> NegInf a Source

Type-restricted constructors