monoid-extras-0.4.0.4: 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
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) Source 
Foldable (Inf p) Source 
Traversable (Inf p) Source 
Eq a => Eq (Inf p a) Source 
(Data p, Data a) => Data (Inf p a) Source 
Ord a => Ord (Inf Neg a) Source 
Ord a => Ord (Inf Pos a) Source 
Read a => Read (Inf p a) Source 
Show a => Show (Inf p a) Source 
Ord a => Monoid (Inf Neg a) Source 
Ord a => Monoid (Inf Pos a) Source 
Ord a => Semigroup (Inf Neg a) Source 
Ord a => Semigroup (Inf Pos a) Source 

data Pos Source

Instances

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

data Neg Source

Instances

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

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