Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data Natural
- toPositive :: Natural -> Maybe Positive
- fromPositive :: Positive -> Natural
- toInteger :: Natural -> Integer
- fromInteger :: Integer -> Maybe Natural
- toSigned :: Natural -> Signed
- fromSigned :: Signed -> Maybe Natural
- toInt :: Natural -> Maybe Int
- fromInt :: Int -> Maybe Natural
- toWord :: Natural -> Maybe Word
- fromWord :: Word -> Natural
- subtract :: Natural -> Natural -> Signed
- strictlyIncrease :: Positive -> Natural -> Natural
- one :: Natural
- addOne :: Natural -> Positive
- subtractOne :: Natural -> Maybe Signed
- length :: [a] -> Natural
Type
Natural number
Invariant: numbers <= 0xffffffffffffffff use the NS
constructor
Instances
Conversion
Positive
fromPositive :: Positive -> Natural Source #