natural is:module
The arbitrary-precision
Natural number type.
Compatibility module for pre ghc-bignum code.
Natural numbers.
The
Numeric.Natural module has become part of
base
starting with `base-4.8.0.0`.
Deprecated: It is no faster than (^)
A data type and class for natural transformations.
Compatibility module for pre ghc-bignum code.
The arbitrary-precision
Natural number type.
Lazy natural numbers. Addition and multiplication recurses over the
first argument, i.e., 1 + n is the way to write the constant
time successor function.
Note that (+) and (*) are not commutative for lazy natural numbers
when considering bottom.
Coercion between Peano Numerals
Nat and builtin
naturals
Nat
Compatibility definitions for working with term and type level natural
numbers across multiple GHC versions.
Prior to GHC 9.2:
- Term level natural numbers: Natural :: Type
- Type level natural numbers: n :: Nat
As of GHC 9.2:
- Term level natural numbers: Natural :: Type
- Type level natural numbers: n :: Natural
To avoid issues, we export a
NaturalK kind that will refer to
the correct definition for your platform.
Turn type-level
Naturals into
Symbols.
Warning: GHC may error out if you pass an
SNat that's
too large to the singled functions, due to reduction stack size.
Follow the error message instructions if you think you need it. This
seems not to happen with
:k!, probably due to different
settings.
Proof by induction over naturals.
Human-friendly text collation