Module

Data.Monoid.Inf

Package
purescript-monoid-extras
Repository
mikesol/purescript-monoid-extras

#Inf Source

data Inf :: forall k. k -> Type -> Typedata Inf p a

@Inf p a@ represents the type 'a' extended with a new "infinite"

Constructors

Instances

#Pos Source

data Pos

Type index indicating positive infinity.

Instances

  • (Ord a) => Ord (Inf Pos a)

    Positive infinity is greater than any finite value.

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

    An ordered type extended with positive infinity is a semigroup

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

    An ordered type extended with positive infinity is a monoid under

#Neg Source

data Neg

Type index indicating negative infinity.

Instances

  • (Ord a) => Ord (Inf Neg a)

    Negative infinity is less than any finite value.

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

    An ordered type extended with negative infinity is a semigroup

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

    An ordered type extended with negative infinity is a monoid under

#PosInf Source

type PosInf a = Inf Pos a

The type 'a' extended with positive infinity.

Instances

#NegInf Source

type NegInf a = Inf Neg a

The type 'a' extended with negative infinity.

Instances

#minimum Source

minimum :: forall a. Ord a => Array a -> PosInf a

Find the minimum of a list of values. Returns positive infinity

#maximum Source

maximum :: forall a. Ord a => Array a -> NegInf a

Find the maximum of a list of values. Returns negative infinity

#posInfty Source

posInfty :: forall a. PosInf a

Positive infinity.

#negInfty Source

negInfty :: forall a. NegInf a

Negative infinity.

#posFinite Source

posFinite :: forall a. a -> PosInf a

Embed a finite value into the space of such values extended with

#negFinite Source

negFinite :: forall a. a -> NegInf a

Embed a finite value into the space of such values extended with