waargonaut-0.8.0.2: JSON wrangling
Safe HaskellNone
LanguageHaskell2010

Waargonaut.Types.JChar.Unescaped

Contents

Description

Types and functions for handling valid unescaped characters in JSON.

Synopsis

Types

newtype Unescaped Source #

Type to specify that this character is unescaped and may be represented using a normal Haskell Char.

Constructors

Unescaped Char 

class AsUnescaped a where Source #

Typeclass for things that may used as an unescaped JChar.

Methods

_Unescaped :: Prism' a Unescaped Source #

Instances

Instances details
AsUnescaped Char Source # 
Instance details

Defined in Waargonaut.Types.JChar.Unescaped

Methods

_Unescaped :: Prism' Char Unescaped Source #

AsUnescaped Unescaped Source # 
Instance details

Defined in Waargonaut.Types.JChar.Unescaped

AsUnescaped (JChar digit) Source # 
Instance details

Defined in Waargonaut.Types.JChar

Methods

_Unescaped :: Prism' (JChar digit) Unescaped Source #

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')