GHC.TypeNats.Internal



Safe Haskell
Trustworthy


Language
Haskell2010



Description
This module exports the Type Nat kind as well as the comparison type family for that kinds. It is needed to prevent module cycles while still allowing these identifiers to be improted in Ord.
Since: base-(612)405-6143

data Natural Source 
Natural number
Invariant: numbers <= 0xffffffffffffffff use the NS constructor

Instances
Instances details


Data Natural Source 
Since: base-(612)405-6143

Instance detailsDefined in Data.Data 
Methods
gfoldl 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Natural -> c Natural Source 
gunfold 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Natural Source 
toConstr 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Constr Source 
dataTypeOf 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> DataType Source 
dataCast1 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Natural) Source 
dataCast2 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Natural) Source 
gmapT 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (forall b. Data b => b -> b) -> Natural -> Natural Source 
gmapQl 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r Source 
gmapQr 8b7c:f320:99b9:690f:4595:cd17:293a:c069 forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r Source 
gmapQ 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (forall d. Data d => d -> u) -> Natural -> [u] Source 
gmapQi 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Int -> (forall d. Data d => d -> u) -> Natural -> u Source 
gmapM 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Monad m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source 
gmapMp 8b7c:f320:99b9:690f:4595:cd17:293a:c069 MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source 
gmapMo 8b7c:f320:99b9:690f:4595:cd17:293a:c069 MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural Source 



Bits Natural Source 
Since: base-4.8.0

Instance detailsDefined in GHC.Bits 
Methods
(.&.) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
(.|.) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
xor 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
complement 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural Source 
shift 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
rotate 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
zeroBits 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural Source 
bit 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Int -> Natural Source 
setBit 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
clearBit 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
complementBit 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
testBit 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Bool Source 
bitSizeMaybe 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Maybe Int Source 
bitSize 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int Source 
isSigned 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Bool Source 
shiftL 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
unsafeShiftL 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
shiftR 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
unsafeShiftR 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
rotateL 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
rotateR 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int -> Natural Source 
popCount 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int Source 



Enum Natural Source 
Since: base-(612)405-6143

Instance detailsDefined in GHC.Enum 
Methods
succ 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural Source 
pred 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural Source 
toEnum 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Int -> Natural Source 
fromEnum 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Int Source 
enumFrom 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> [Natural] Source 
enumFromThen 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> [Natural] Source 
enumFromTo 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> [Natural] Source 
enumFromThenTo 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural -> [Natural] Source 



Ix Natural Source 
Since: base-(612)405-6143

Instance detailsDefined in GHC.Ix 
Methods
range 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (Natural, Natural) -> [Natural] Source 
index 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (Natural, Natural) -> Natural -> Int Source 
unsafeIndex 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (Natural, Natural) -> Natural -> Int Source 
inRange 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (Natural, Natural) -> Natural -> Bool Source 
rangeSize 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (Natural, Natural) -> Int Source 
unsafeRangeSize 8b7c:f320:99b9:690f:4595:cd17:293a:c069 (Natural, Natural) -> Int Source 



Num Natural 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-(612)405-6143


Instance detailsDefined in GHC.Num 
Methods
(+) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
(-) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
(*) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
negate 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural Source 
abs 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural Source 
signum 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural Source 
fromInteger 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Integer -> Natural Source 



Read Natural Source 
Since: base-(612)405-6143

Instance detailsDefined in GHC.Read 
Methods
readsPrec 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Int -> ReadS Natural Source 
readList 8b7c:f320:99b9:690f:4595:cd17:293a:c069 ReadS [Natural] Source 
readPrec 8b7c:f320:99b9:690f:4595:cd17:293a:c069 ReadPrec Natural Source 
readListPrec 8b7c:f320:99b9:690f:4595:cd17:293a:c069 ReadPrec [Natural] Source 



Integral Natural Source 
Since: base-(612)405-6143

Instance detailsDefined in GHC.Real 
Methods
quot 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
rem 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
div 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
mod 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
quotRem 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> (Natural, Natural) Source 
divMod 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> (Natural, Natural) Source 
toInteger 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Integer Source 



Real Natural Source 
Since: base-(612)405-6143

Instance detailsDefined in GHC.Real 
Methods
toRational 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Rational Source 



Show Natural Source 
Since: base-(612)405-6143

Instance detailsDefined in GHC.Show 
Methods
showsPrec 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Int -> Natural -> ShowS Source 
show 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> String Source 
showList 8b7c:f320:99b9:690f:4595:cd17:293a:c069 [Natural] -> ShowS Source 



PrintfArg Natural Source 
Since: base-(612)405-6143

Instance detailsDefined in Text.Printf 
Methods
formatArg 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> FieldFormatter Source 
parseFormat 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> ModifierParser Source 



Eq Natural

 

Instance detailsDefined in GHC.Num.Natural 
Methods
(==) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Bool Source 
(/=) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Bool Source 



Ord Natural

 

Instance detailsDefined in GHC.Num.Natural 
Methods
compare 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Ordering Source 
(<) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Bool Source 
(<=) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Bool Source 
(>) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Bool Source 
(>=) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Bool Source 
max 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 
min 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural -> Natural -> Natural Source 



KnownNat n => HasResolution (n 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Nat) Source 
For example, Fixed 1000 will give you a Fixed with a resolution of 1000.

Instance detailsDefined in Data.Fixed 
Methods
resolution 8b7c:f320:99b9:690f:4595:cd17:293a:c069 p n -> Integer Source 



 type Compare (a 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural) (b 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural) Source 
 

Instance detailsDefined in Data.Type.Ord type Compare (a 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural) (b 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural) = CmpNat a b


type family CmpNat (m 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural) (n 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Natural) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Ordering Source 
Comparison of type-level naturals, as a function.
Since: base-(612)405-6143


    
{'path': 'public/docs/haskell~9/libraries/base-4.17.0.0/ghc-typenats-internal.html', 'source': 'DevDocs.IO'}