Numeric.Natural

nats-0.1: Haskell 98 natural numbers

Copyright | (C) 2011 Edward Kmett,
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Numeric.Natural

Description

Natural numbers.

Synopsis

- data Natural
- class Integral n => Whole n where
  - toNatural :: n -> Natural

# Documentation

data Natural

Instances

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

class Integral n => Whole n where

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

Minimal complete definition

toNatural, unsafePred

Methods

toNatural :: n -> Natural

Instances

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