type-level-bytestrings-0.1.0: Tools for manipulating type-level bytes and bytestrings
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Type.Symbol.Utf8

Description

Type-level UTF-8 codepoint conversion.

Synopsis

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.