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

Bounded.ts overview

Since v0.24.0


Exports Grouped by Category


constructors

max

Monoid that returns last maximum of elements.

Signature

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

Source

Since v0.24.0

min

Monoid that returns last minimum of elements.

Signature

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

Source

Since v0.24.0

predicates

between

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

Signature

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

Source

Since v0.24.0

type class

Bounded (interface)

Signature

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

Source

Since v0.24.0

type lambdas

BoundedTypeLambda (interface)

Signature

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

Source

Since v0.24.0

utils

clamp

Clamp a value between minBound and maxBound values.

Signature

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

Source

Since v0.24.0

reverse

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

Signature

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

Source

Since v0.24.0