basement-0.0.10: Foundation scrap box of array & string

Basement.Compat.Natural

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
 Since: base-4.8.0.0 Instance detailsDefined in GHC.Enum MethodsenumFrom :: Natural -> [Natural] #enumFromThen :: Natural -> Natural -> [Natural] #enumFromTo :: Natural -> Natural -> [Natural] #enumFromThenTo :: Natural -> Natural -> Natural -> [Natural] # Since: base-4.8.0.0 Instance detailsDefined in GHC.Natural Methods(==) :: Natural -> Natural -> Bool #(/=) :: Natural -> Natural -> Bool # Since: base-4.8.0.0 Instance detailsDefined in GHC.Real MethodsquotRem :: Natural -> Natural -> (Natural, Natural) #divMod :: Natural -> Natural -> (Natural, Natural) # Since: base-4.8.0.0 Instance detailsDefined in Data.Data Methodsgfoldl :: (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 #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 # 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 detailsDefined in GHC.Num Methods Since: base-4.8.0.0 Instance detailsDefined in GHC.Natural Methods(<) :: Natural -> Natural -> Bool #(<=) :: Natural -> Natural -> Bool #(>) :: Natural -> Natural -> Bool #(>=) :: Natural -> Natural -> Bool # Since: base-4.8.0.0 Instance detailsDefined in GHC.Read Methods Since: base-4.8.0.0 Instance detailsDefined in GHC.Real Methods Since: base-4.8.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [Natural] -> ShowS # Since: base-4.8.0.0 Instance detailsDefined in GHC.Arr Methodsrange :: (Natural, Natural) -> [Natural] #index :: (Natural, Natural) -> Natural -> Int #unsafeIndex :: (Natural, Natural) -> Natural -> IntinRange :: (Natural, Natural) -> Natural -> Bool #rangeSize :: (Natural, Natural) -> Int #unsafeRangeSize :: (Natural, Natural) -> Int Since: base-4.8.0 Instance detailsDefined in Data.Bits Methodsshift :: Natural -> Int -> Natural #rotate :: Natural -> Int -> Natural #bit :: Int -> Natural #setBit :: Natural -> Int -> Natural #testBit :: Natural -> Int -> Bool #shiftL :: Natural -> Int -> Natural #shiftR :: Natural -> Int -> Natural # # Instance detailsDefined in Basement.Compat.NumLiteral Methods # Instance detailsDefined in Basement.Numerical.Number Methods # Instance detailsDefined in Basement.Numerical.Number Methods # Instance detailsDefined in Basement.Numerical.Subtractive Associated Typestype Difference Natural :: Type # Methods # Instance detailsDefined in Basement.Numerical.Additive Methodsscale :: IsNatural n => n -> Natural -> Natural # # Instance detailsDefined in Basement.Numerical.Multiplicative MethodsdivMod :: Natural -> Natural -> (Natural, Natural) # # Instance detailsDefined in Basement.Numerical.Multiplicative Methods(^) :: (IsNatural n, Enum n, IDivisible n) => Natural -> n -> Natural # # Instance detailsDefined in Basement.NormalForm MethodstoNormalForm :: Natural -> () # # Instance detailsDefined in Basement.IntegralConv MethodsintegralUpsize :: a -> Natural # # Instance detailsDefined in Basement.IntegralConv Methods # Instance detailsDefined in Basement.IntegralConv Methods # Instance detailsDefined in Basement.IntegralConv Methods # Instance detailsDefined in Basement.IntegralConv Methods # Instance detailsDefined in Basement.IntegralConv Methods IsNatural n => From n Natural # Instance detailsDefined in Basement.From Methodsfrom :: n -> Natural # # Instance detailsDefined in Basement.Numerical.Subtractive