base-4.11.0.0: Basic libraries

Numeric.Natural

Description

The arbitrary-precision Natural number type.

Since: 4.8.0.0

Synopsis

# Documentation

data Natural Source #

Type representing arbitrary-precision non-negative integers.

>>> 2^20 :: Natural
1267650600228229401496703205376


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

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


Since: 4.8.0.0

Instances
 Source # Since: 4.8.0.0 Instance detailsMethods Source # Instance detailsMethods(==) :: Natural -> Natural -> Bool #(/=) :: Natural -> Natural -> Bool # Source # Since: 4.8.0.0 Instance detailsMethods Source # Since: 4.8.0.0 Instance detailsMethodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Natural -> c Natural Source #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Natural Source #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Natural) Source #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Natural) Source #gmapT :: (forall b. Data b => b -> b) -> Natural -> Natural Source #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r Source #gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r Source #gmapQ :: (forall d. Data d => d -> u) -> Natural -> [u] Source #gmapQi :: Int -> (forall d. Data d => d -> u) -> Natural -> u Source #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source # Source # Since: 4.8.0.0 Instance detailsMethods Source # Instance detailsMethods(<) :: Natural -> Natural -> Bool #(<=) :: Natural -> Natural -> Bool #(>) :: Natural -> Natural -> Bool #(>=) :: Natural -> Natural -> Bool # Source # Since: 4.8.0.0 Instance detailsMethods Source # Since: 4.8.0.0 Instance detailsMethods Source # Since: 4.8.0.0 Instance detailsMethodsshowList :: [Natural] -> ShowS Source # Source # Since: 4.8.0.0 Instance detailsMethodsrange :: (Natural, Natural) -> [Natural] Source #index :: (Natural, Natural) -> Natural -> Int Source #unsafeIndex :: (Natural, Natural) -> Natural -> IntinRange :: (Natural, Natural) -> Natural -> Bool Source #rangeSize :: (Natural, Natural) -> Int Source #unsafeRangeSize :: (Natural, Natural) -> Int Source # Since: 4.8.0.0 Instance detailsMethods Source # Since: 4.8.0.0 Instance detailsMethods