Portability | see LANGUAGE pragmas (... GHC) |
---|---|
Stability | experimental |
Maintainer | [email protected] |
Safe Haskell | None |
Type.Digits
Description
Type-level numerals built from type-level digits of an arbitrary radix.
- digitStrings :: [String]
- radix :: Num i => i
- data Digit
- digit :: (Show a, Eq a, Num a) => a -> Name
- toType :: [Name] -> Type -> Type
- toType_ :: [Name] -> Type
- toDigits :: (a -> [Name]) -> a -> Type -> Type
- toDigits_ :: (a -> [Name]) -> a -> Type
- flexible :: (Show a, Eq a, Integral a) => a -> [Name]
- fixed :: forall a. (Bounded a, Show a, Eq a, Integral a) => a -> [Name]
- flexible' :: Enum a => a -> [Name]
- fixed' :: Enum a => a -> [Name]
- exactly :: Int -> [Name] -> [Name]
- digitNames :: [Name]
- digitTypes :: [Type]
- digitStopName :: Name
- digitStopType :: Type
Documentation
digitStrings :: [String]Source
The names of the digits.
digit :: (Show a, Eq a, Num a) => a -> NameSource
Convert a number to the name of the corresponding digit -- error if the argument is out of range.
flexible :: (Show a, Eq a, Integral a) => a -> [Name]Source
Converts an Integral
to a type-level numeral using as many digits as it
takes that particular number.
fixed :: forall a. (Bounded a, Show a, Eq a, Integral a) => a -> [Name]Source
Converts a Bounded
Integral
to a type-level numeral using exactly the
number of digits it takes to represent each value of that type uniquely.
exactly :: Int -> [Name] -> [Name]Source
Pads its second argument so that the resulting length is its first argument; fails if the second argument is already larger.
digitNames :: [Name]Source
digitTypes :: [Type]Source