Skip to main content Link Search Menu Expand Document (external link)

Bounded overview

Added in v0.24.0


Table of contents


constructors

max

Monoid that returns last maximum of elements.

Signature

export declare const max: <A>(B: Bounded<A>) => Monoid<A>

Added in v0.24.0

min

Monoid that returns last minimum of elements.

Signature

export declare const min: <A>(B: Bounded<A>) => Monoid<A>

Added in v0.24.0

predicates

between

Checks if a value is between the lower and upper limit of a bound.

Signature

export declare const between: <A>(B: Bounded<A>) => (a: A) => boolean

Added in v0.24.0

type class

Bounded (interface)

Signature

export interface Bounded<A> {
  readonly compare: Order<A>
  readonly maxBound: A
  readonly minBound: A
}

Added in v0.24.0

type lambdas

BoundedTypeLambda (interface)

Signature

export interface BoundedTypeLambda extends TypeLambda {
  readonly type: Bounded<this["Target"]>
}

Added in v0.24.0

utils

clamp

Clamp a value between minBound and maxBound values.

Signature

export declare const clamp: <A>(B: Bounded<A>) => (a: A) => A

Added in v0.24.0

reverse

Reverses the Order of a Bounded and flips maxBound and minBound values.

Signature

export declare const reverse: <A>(B: Bounded<A>) => Bounded<A>

Added in v0.24.0