Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/number.ts

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
import * as fun from "https://deno.land/x/fun@v.2.0.0-alpha.11/number.ts";

The number module contains combinators for working with numbers.

Variables

The canonical implementation of Eq for number. It contains the method equal.

A Monoid instance for number that uses Math.max for concatenation. It contains the method concat.

A Monoid instance for number that uses Math.min for concatenation. It contains the method concat.

A Monoid instance for number that uses multiplication for concatenation. It contains the method concat.

A Monoid instance for number that uses addition for concatenation. It contains the method concat.

The canonical implementation of Ord for number. It contains the method compare.

A Semigroup instance for number that uses Math.max for concatenation. It contains the method concat.

A Semigroup instance for number that uses Math.min for concatenation. It contains the method concat.

A Semigroup instance for number that uses multiplication for concatenation. It contains the method concat.

A Semigroup instance for number that uses addition for concatenation. It contains the method concat.

The canonical instance of Show for number. It contains the method show.

Functions

Add two numbers.

Compare two numbers and return their Ordering. 0 denotes equality, -1 denotes that first is less than second, and 1 denotes that first is greater than second.

Return true if first evenly divides second.

A constant function that always returns Number.NEGATIVE_INFINITY. This is the maximum identity and is used as the empty value for MonoidNumberMiximum.

A constant function that always returns 1. This is the multiplicative identity and is used as the empty value for MonoidNumberProduct.

A constant function that always returns Number.POSITIVE_INFINITY. This is the minimum identity and is used as the empty value for MonoidNumberMinimum.

A constant function that always returns 0. This is the additive identity and is used as the empty value for MonoidNumberSum.

Compare two numbers and return true if they are equal.

Compare two numbers and return true if first is less than or equal to second.

Return the positive modulus of two numbers.

Multiply two numbers.