Skip to content

Bounded

7 exports Added in v0.24.0 Source

Constructors

max

Added in v0.24.0 Source

Monoid that returns last maximum of elements.

Signature

declare function max<A>(B: Bounded<A>): Monoid<A>;

min

Added in v0.24.0 Source

Monoid that returns last minimum of elements.

Signature

declare function min<A>(B: Bounded<A>): Monoid<A>;

Predicates

between

Added in v0.24.0 Source

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

Signature

declare function between<A>(B: Bounded<A>): (a: A) => boolean;

Type Class

Bounded interface

Added in v0.24.0 Source

Signature

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

Type Lambdas

BoundedTypeLambda interface

Added in v0.24.0 Source

Signature

interface BoundedTypeLambda extends TypeLambda {
  readonly type: Bounded<unknown>;
}

Utils

clamp

Added in v0.24.0 Source

Clamp a value between minBound and maxBound values.

Signature

declare function clamp<A>(B: Bounded<A>): (a: A) => A;

reverse

Added in v0.24.0 Source

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

Signature

declare function reverse<A>(B: Bounded<A>): Bounded<A>;