base-4.16.0.0: Basic libraries

Numeric.Natural

Description

The arbitrary-precision Natural number type.

Since: base-4.8.0.0

Synopsis

# Documentation

data Natural Source #

Natural number

Invariant: numbers <= 0xffffffffffffffff use the NS constructor

#### Instances

Instances details
 Source # 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 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 :: forall r r'. (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: base-4.8.0 Instance detailsDefined in GHC.Bits Methods Source # Since: base-4.8.0.0 Instance detailsDefined in GHC.Enum Methods Source # Since: base-4.8.0.0 Instance detailsDefined in GHC.Ix Methodsrange :: (Natural, Natural) -> [Natural] Source #index :: (Natural, Natural) -> Natural -> Int Source #unsafeIndex :: (Natural, Natural) -> Natural -> Int Source #inRange :: (Natural, Natural) -> Natural -> Bool Source #rangeSize :: (Natural, Natural) -> Int Source # Source # 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 Source # Since: base-4.8.0.0 Instance detailsDefined in GHC.Read Methods Source # Since: base-4.8.0.0 Instance detailsDefined in GHC.Real Methods Source # Since: base-4.8.0.0 Instance detailsDefined in GHC.Real Methods Source # Since: base-4.8.0.0 Instance detailsDefined in GHC.Show MethodsshowList :: [Natural] -> ShowS Source # Source # Since: base-4.8.0.0 Instance detailsDefined in Text.Printf Methods Instance detailsDefined in GHC.Num.Natural Methods Instance detailsDefined in GHC.Num.Natural Methods KnownNat n => HasResolution (n :: Nat) Source # For example, Fixed 1000 will give you a Fixed with a resolution of 1000. Instance detailsDefined in Data.Fixed Methodsresolution :: p n -> Integer Source # type Compare (a :: Natural) (b :: Natural) Source # Instance detailsDefined in Data.Type.Ord type Compare (a :: Natural) (b :: Natural) = CmpNat a b