numbers-3000.2.0.2: Various number types

Safe HaskellSafe
LanguageHaskell98

Data.Number.Natural

Description

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.

Synopsis

Documentation

data Natural Source #

Instances

Enum Natural Source # 
Eq Natural Source # 

Methods

(==) :: Natural -> Natural -> Bool #

(/=) :: Natural -> Natural -> Bool #

Integral Natural Source # 
Num Natural Source # 
Ord Natural Source # 
Real Natural Source # 
Show Natural Source # 

infinity :: Natural Source #

The infinite natural number.