nats-0.1.2: Haskell 98 natural numbers

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellSafe-Inferred

Numeric.Natural.Internal

Description

This module exposes the potentially unsafe operations that are sometimes needed for efficiency: The Natural data constructor and unsafePred.

Synopsis

Documentation

newtype Natural

Constructors

Natural 

Fields

runNatural :: Integer
 

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

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

Methods

toNatural :: n -> Natural

unsafePred :: n -> n

Instances

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

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

Church decoding