Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
"r-UNICODE.D76" restricts Unicode characters by excluding the range U+D800 to U+DFFF.
This is important because the commonly used Text
type from text package replaces chars that are in range
U+D800 to U+DFFF (inclusive).
Note, there is no IsSuperset "r-UNICODE.D76" "r-CHAR8"
mapping even though the numeric range of D76 includes all CHAR8 bytes.
This is more nominal decision that prevents certain unwanted conversions from being possible.
Similarly there is no IsSuperset "r-UNICODE.D76" "r-ByteRep", "r-UNICODE.D76" acts as a guard to what can go into Text
and this prevents some unwanted conversions.
Since: 0.4.0.0
Synopsis
- newtype NonTextChar = NonTextChar Char
- encD76Char :: Encoding (Either EncodeEx) "r-UNICODE.D76" "r-UNICODE.D76" c Char
- encD76 :: Encoding (Either EncodeEx) "r-UNICODE.D76" "r-UNICODE.D76" c String
- trustMe :: Applicative f => Encoding f "r-UNICODE.D76" "r-UNICODE.D76" c String
- nonTextChar :: Char -> Bool
- encImpl :: String -> Either NonTextChar String
Documentation
>>>
:set -XDataKinds -XTypeApplications
newtype NonTextChar Source #
Instances
Eq NonTextChar Source # | |
Defined in Data.TypedEncoding.Instances.Restriction.D76 (==) :: NonTextChar -> NonTextChar -> Bool # (/=) :: NonTextChar -> NonTextChar -> Bool # | |
Show NonTextChar Source # | |
Defined in Data.TypedEncoding.Instances.Restriction.D76 showsPrec :: Int -> NonTextChar -> ShowS # show :: NonTextChar -> String # showList :: [NonTextChar] -> ShowS # |
Encoding "r-UNICODE.D76"
trustMe :: Applicative f => Encoding f "r-UNICODE.D76" "r-UNICODE.D76" c String Source #
No-check version
Decoding "r-UNICODE.D76"
Implementation
nonTextChar :: Char -> Bool Source #
Orphan instances
(RecreateErr f, Applicative f) => Validate f "r-UNICODE.D76" "r-UNICODE.D76" () String Source # | |
validation :: Validation f "r-UNICODE.D76" "r-UNICODE.D76" () String Source # | |
Applicative f => Decode f "r-UNICODE.D76" "r-UNICODE.D76" c str Source # | |
Encode (Either EncodeEx) "r-UNICODE.D76" "r-UNICODE.D76" c String Source # | |
Encode (Either EncodeEx) "r-UNICODE.D76" "r-UNICODE.D76" c Char Source # | |