Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
TypeLevelShow.Natural.Digit
Description
Unsafe Natural
digit renderers.
These are used by TypeLevelShow.Natural, where modulo arithmetic guarantees that they are not used unsafely.
Synopsis
- type family ShowNatDigitHexLower (d :: Natural) :: Char where ...
- data ShowNatDigitHexLowerSym d
- sShowNatDigitHexLower :: Lam SNat SChar ShowNatDigitHexLowerSym
- type family ShowNatDigitHexUpper (d :: Natural) :: Char where ...
- data ShowNatDigitHexUpperSym d
- sShowNatDigitHexUpper :: Lam SNat SChar ShowNatDigitHexUpperSym
- type ENotDigitOfBase base = (Text "got non-" :<>: Text base) :<>: Text " digit"
Documentation
type family ShowNatDigitHexLower (d :: Natural) :: Char where ... Source #
Return the associated lower-case Char
for a Natural
hexadecimal digit.
Unsafe. Must be called with 0-15.
Equations
ShowNatDigitHexLower 0 = '0' | |
ShowNatDigitHexLower 1 = '1' | |
ShowNatDigitHexLower 2 = '2' | |
ShowNatDigitHexLower 3 = '3' | |
ShowNatDigitHexLower 4 = '4' | |
ShowNatDigitHexLower 5 = '5' | |
ShowNatDigitHexLower 6 = '6' | |
ShowNatDigitHexLower 7 = '7' | |
ShowNatDigitHexLower 8 = '8' | |
ShowNatDigitHexLower 9 = '9' | |
ShowNatDigitHexLower 10 = 'a' | |
ShowNatDigitHexLower 11 = 'b' | |
ShowNatDigitHexLower 12 = 'c' | |
ShowNatDigitHexLower 13 = 'd' | |
ShowNatDigitHexLower 14 = 'e' | |
ShowNatDigitHexLower 15 = 'f' | |
ShowNatDigitHexLower n = ErrorPDoc (ENotDigitOfBase "hexadecimal") |
data ShowNatDigitHexLowerSym d Source #
Instances
type App ShowNatDigitHexLowerSym (d :: Natural) Source # | |
Defined in TypeLevelShow.Natural.Digit |
type family ShowNatDigitHexUpper (d :: Natural) :: Char where ... Source #
Return the associated upper-case Char
for a Natural
hexadecimal digit.
Unsafe. Must be called with 0-15.
Equations
ShowNatDigitHexUpper 0 = '0' | |
ShowNatDigitHexUpper 1 = '1' | |
ShowNatDigitHexUpper 2 = '2' | |
ShowNatDigitHexUpper 3 = '3' | |
ShowNatDigitHexUpper 4 = '4' | |
ShowNatDigitHexUpper 5 = '5' | |
ShowNatDigitHexUpper 6 = '6' | |
ShowNatDigitHexUpper 7 = '7' | |
ShowNatDigitHexUpper 8 = '8' | |
ShowNatDigitHexUpper 9 = '9' | |
ShowNatDigitHexUpper 10 = 'A' | |
ShowNatDigitHexUpper 11 = 'B' | |
ShowNatDigitHexUpper 12 = 'C' | |
ShowNatDigitHexUpper 13 = 'D' | |
ShowNatDigitHexUpper 14 = 'E' | |
ShowNatDigitHexUpper 15 = 'F' |
data ShowNatDigitHexUpperSym d Source #
Instances
type App ShowNatDigitHexUpperSym (d :: Natural) Source # | |
Defined in TypeLevelShow.Natural.Digit |
type ENotDigitOfBase base = (Text "got non-" :<>: Text base) :<>: Text " digit" Source #
Type-level error message displayed when a digit renderer receives a digit not present in the base it handles.
Note that we can't show the digit, unless we use ShowType
. Which
type-level-show is about avoiding. Not really an issue, it should be clear in
the type error.