Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types and functions for handling valid unescaped characters in JSON.
Synopsis
- newtype Unescaped = Unescaped Char
- class AsUnescaped a where
- _Unescaped :: Prism' a Unescaped
- parseUnescaped :: CharParsing f => f Unescaped
Types
Type to specify that this character is unescaped and may be represented
using a normal Haskell Char
.
class AsUnescaped a where Source #
Typeclass for things that may used as an unescaped JChar.
_Unescaped :: Prism' a Unescaped Source #
Instances
AsUnescaped Char Source # | |
Defined in Waargonaut.Types.JChar.Unescaped | |
AsUnescaped Unescaped Source # | |
Defined in Waargonaut.Types.JChar.Unescaped | |
AsUnescaped (JChar digit) Source # | |
Defined in Waargonaut.Types.JChar |
Parser
parseUnescaped :: CharParsing f => f Unescaped Source #
Parse an unescaped JSON character.
>>>
testparse parseUnescaped "a"
Right (Unescaped 'a')
>>>
testparse parseUnescaped "\8728"
Right (Unescaped '\8728')
>>>
testparsetheneof parseUnescaped "a"
Right (Unescaped 'a')
>>>
testparsethennoteof parseUnescaped "ax"
Right (Unescaped 'a')