numbers-3000.2.0.2: Various number types

Safe Haskell | Safe-Inferred
Language | Haskell98

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

- data Natural
- infinity :: Natural

# Documentation

data Natural Source #

#### Instances

Instances details

Enum Natural Source # |

Instance details

Defined in Data.Number.Natural

Methods

succ :: Natural -> Natural Source #

pred :: Natural -> Natural Source #

toEnum :: Int -> Natural Source #

fromEnum :: Natural -> Int Source #

enumFrom :: Natural -> [Natural] Source #

enumFromThen :: Natural -> Natural -> [Natural] Source #

enumFromTo :: Natural -> Natural -> [Natural] Source #

enumFromThenTo :: Natural -> Natural -> Natural -> [Natural] Source #

Num Natural Source # |
Instance details Defined in Data.Number.Natural Methods (+) :: Natural -> Natural -> Natural Source # (-) :: Natural -> Natural -> Natural Source # (*) :: Natural -> Natural -> Natural Source # negate :: Natural -> Natural Source # abs :: Natural -> Natural Source # signum :: Natural -> Natural Source # fromInteger :: Integer -> Natural Source #
Integral Natural Source # |

Instance details

Defined in Data.Number.Natural

Methods

quot :: Natural -> Natural -> Natural Source #

rem :: Natural -> Natural -> Natural Source #

div :: Natural -> Natural -> Natural Source #

mod :: Natural -> Natural -> Natural Source #

quotRem :: Natural -> Natural -> (Natural, Natural) Source #

divMod :: Natural -> Natural -> (Natural, Natural) Source #

toInteger :: Natural -> Integer Source #

Real Natural Source # |
Instance details Defined in Data.Number.Natural Methods toRational :: Natural -> Rational Source #
Show Natural Source # |
Instance details Defined in Data.Number.Natural Methods showsPrec :: Int -> Natural -> ShowS Source # show :: Natural -> String Source # showList :: [Natural] -> ShowS Source #
Eq Natural Source # |
Instance details Defined in Data.Number.Natural Methods (==) :: Natural -> Natural -> Bool Source # (/=) :: Natural -> Natural -> Bool Source #
Ord Natural Source # |
Instance details Defined in Data.Number.Natural Methods compare :: Natural -> Natural -> Ordering Source # (<) :: Natural -> Natural -> Bool Source # (<=) :: Natural -> Natural -> Bool Source # (>) :: Natural -> Natural -> Bool Source # (>=) :: Natural -> Natural -> Bool Source # max :: Natural -> Natural -> Natural Source # min :: Natural -> Natural -> Natural Source #

infinity :: Natural Source #

The infinite natural number.