waargonaut-0.8.0.1: 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.

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