base-4.12.0.0: Basic libraries

Copyright(C) 2014 Herbert Valerio Riedel
(C) 2011 Edward Kmett
Licensesee libraries/base/LICENSE
Maintainerlibraries@haskell.org
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

Numeric.Natural

Description

The arbitrary-precision Natural number type.

Since: base-4.8.0.0

Synopsis

Documentation

data Natural #

Type representing arbitrary-precision non-negative integers.

>>> 2^100 :: Natural
1267650600228229401496703205376

Operations whose result would be negative throw (Underflow :: ArithException),

>>> -1 :: Natural
*** Exception: arithmetic underflow

Since: base-4.8.0.0

Instances
Enum Natural #

Since: base-4.8.0.0

Instance details

Defined in GHC.Enum

Eq Natural #

Since: base-4.8.0.0

Instance details

Defined in GHC.Natural

Integral Natural #

Since: base-4.8.0.0

Instance details

Defined in GHC.Real

Data Natural #

Since: base-4.8.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Natural -> c Natural #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Natural #

toConstr :: Natural -> Constr #

dataTypeOf :: Natural -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Natural) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Natural) #

gmapT :: (forall b. Data b => b -> b) -> Natural -> Natural #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r #

gmapQ :: (forall d. Data d => d -> u) -> Natural -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Natural -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Natural -> m Natural #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural #

Num Natural #

Note that Natural's Num instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.

Since: base-4.8.0.0

Instance details

Defined in GHC.Num

Ord Natural #

Since: base-4.8.0.0

Instance details

Defined in GHC.Natural

Read Natural #

Since: base-4.8.0.0

Instance details

Defined in GHC.Read

Real Natural #

Since: base-4.8.0.0

Instance details

Defined in GHC.Real

Show Natural #

Since: base-4.8.0.0

Instance details

Defined in GHC.Show

Ix Natural #

Since: base-4.8.0.0

Instance details

Defined in GHC.Arr

Bits Natural #

Since: base-4.8.0

Instance details

Defined in Data.Bits

PrintfArg Natural #

Since: base-4.8.0.0

Instance details

Defined in Text.Printf