The implementations of all functions except for rem, quot, div, mod are supposed to be as non-strict as possible.
- data NatO
- cmpNatOLT :: NatO -> NatO -> Ordering
- fromNatO :: Num n => NatO -> n
- toNatO :: (Integral n, Num n) => n -> NatO
- length :: [a] -> NatO
- take :: NatO -> [a] -> [a]
- drop :: NatO -> [a] -> [a]
- replicate :: NatO -> a -> [a]
- lengthNum :: (Enum n, Num n) => [a] -> n
- takeNum :: (Enum n, Num n) => n -> [a] -> [a]
- dropNum :: (Enum n, Num n) => n -> [a] -> [a]
- replicateNum :: (Enum n, Num n) => n -> a -> [a]
Natural numbers and zero
This function is used to implement lazy instances of compare and (<), (<=), (>), (>=). It is used to transfer information to more significant bits. Instead of yielding EQ it yields LT if the numbers are equal.
This is used for the implementation of fromInteger and toEnum.