nats-0.1.2: Haskell 98 natural numbers

Portability | portable
Stability | provisional
Maintainer | Edward Kmett <ekmett@gmail.com>
Safe Haskell | Safe-Inferred

Numeric.Natural

Description

Natural numbers.

Synopsis

- data Natural
- class Integral n => Whole n where
  - toNatural :: n -> Natural
- natural :: a -> (a -> a) -> Natural -> a

# Documentation

data Natural Source

Instances

Enum Natural |
Eq Natural |
Integral Natural |
Num Natural |
Ord Natural |
Read Natural |
Real Natural |
Show Natural |
Ix Natural |
Typeable Natural |
Bits Natural |
Whole Natural |

class Integral n => Whole n where Source

A refinement of `Integral` to represent types that do not contain negative numbers.

Methods

toNatural :: n -> Natural Source

Instances

Whole Word |
Whole Word8 |
Whole Word16 |
Whole Word32 |
Whole Word64 |
Whole Natural |

natural :: a -> (a -> a) -> Natural -> aSource

Church decoding