Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Type-level UTF-8 codepoint conversion.
Synopsis
- type SymbolToUtf8 sym = SymbolToUtf8' '[] (UnconsSymbol sym)
- type CharToUtf8 ch = UnicodeCodePointToUtf8 (CharToNat ch)
- type UnicodeCodePointToUtf8 n = IfNatLte n 127 '[n] (IfNatLte n 2047 (UCP2 n) (IfNatLte n 65535 (UCP3 n) (IfNatLte n 1114111 (UCP4 n) (TypeError ('Text "not a Unicode codepoint: " :<>: 'ShowType n)))))
Documentation
type SymbolToUtf8 sym = SymbolToUtf8' '[] (UnconsSymbol sym) Source #
Convert a type-level symbol to UTF-8.
Each Natural
in the return list is "byte-sized" (0 <= n <= 0xFF).
type CharToUtf8 ch = UnicodeCodePointToUtf8 (CharToNat ch) Source #
Convert a type-level character to UTF-8.
Each Natural
in the return list is "byte-sized" (0 <= n <= 0xFF).
type UnicodeCodePointToUtf8 n = IfNatLte n 127 '[n] (IfNatLte n 2047 (UCP2 n) (IfNatLte n 65535 (UCP3 n) (IfNatLte n 1114111 (UCP4 n) (TypeError ('Text "not a Unicode codepoint: " :<>: 'ShowType n))))) Source #
Convert a type-level Unicode code point to UTF-8
Emits a type error if you give it an invalid codepoint.