parsley-2.0.0.1: A fast parser combinator library backed by Typed Template Haskell
LicenseBSD-3-Clause
MaintainerJamie Willis
Stabilitystable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Parsley.InputExtras

Description

This module exports the Stream datatype, which can be used as an infinite input to a parser. It also exports Text16 and CharList, which can be wrapped around Text and String respectively to force them to be parsed faithfully to their representation. By default, Strings are converted to character arrays for performance, but CharList will be uncoverted. On the other hand, Text16 enables a faster, but potentially less general processing of Text data by assuming all characters are exactly 16-bits in width.

Since: 0.1.0.0

Synopsis

Documentation

nomore :: Stream #

The "end" of a stream, an infinite stream of '\0' (null) characters

Since: parsley-core-0.1.0.0

newtype Text16 #

By wrapping a regular Text input with this newtype, Parsley will assume that all of the characters fit into exactly one 16-bit chunk. This allows the consumption of characters in the datatype to be consumed much faster, but does not support multi-word characters.

Since: parsley-core-0.1.0.0

Constructors

Text16 Text 

Instances

Instances details
Input Text16 
Instance details

Defined in Parsley.Internal.Backend.Machine

HandlerOps Text16 
Instance details

Defined in Parsley.Internal.Backend.Machine.BindingOps

Methods

bindHandler# :: StaHandler# s Text16 a -> (DynHandler s Text16 a -> Code b) -> Code b #

JoinBuilder Text16 
Instance details

Defined in Parsley.Internal.Backend.Machine.BindingOps

Methods

setupJoinPoint# :: StaCont# s Text16 a x -> (DynCont s Text16 a x -> Code b) -> Code b #

MarshalOps Text16 
Instance details

Defined in Parsley.Internal.Backend.Machine.BindingOps

RecBuilder Text16 
Instance details

Defined in Parsley.Internal.Backend.Machine.BindingOps

Methods

bindIterHandler# :: (Input# Text16 -> StaHandler# s Text16 a) -> (Code (Pos -> DynRep Text16 -> Handler# s Text16 a) -> Code b) -> Code b #

bindIter# :: Input# Text16 -> (Code (Pos -> DynRep Text16 -> ST s (Maybe a)) -> Input# Text16 -> Code (ST s (Maybe a))) -> Code (ST s (Maybe a)) #

bindRec# :: (DynSubroutine s Text16 a x -> StaSubroutine# s Text16 a x) -> DynSubroutine s Text16 a x #

InputPrep Text16 
Instance details

Defined in Parsley.Internal.Backend.Machine.InputOps

Methods

_prepare :: starep ~ StaRep Text16 => Code Text16 -> (InputOps starep -> starep -> Code r) -> Code r

newtype CharList #

By wrapping a regular String with this newtype, Parsley will not preprocess it into an array of characters, instead using regular pattern matching for the implementation.

Since: parsley-core-0.1.0.0

Constructors

CharList String 

data Stream #

An input type that represents an infinite stream of input characters.

Since: parsley-core-0.1.0.0

Constructors

!Char :> Stream 

Instances

Instances details
Input Stream 
Instance details

Defined in Parsley.Internal.Backend.Machine

HandlerOps Stream 
Instance details

Defined in Parsley.Internal.Backend.Machine.BindingOps

Methods

bindHandler# :: StaHandler# s Stream a -> (DynHandler s Stream a -> Code b) -> Code b #

JoinBuilder Stream 
Instance details

Defined in Parsley.Internal.Backend.Machine.BindingOps

Methods

setupJoinPoint# :: StaCont# s Stream a x -> (DynCont s Stream a x -> Code b) -> Code b #

MarshalOps Stream 
Instance details

Defined in Parsley.Internal.Backend.Machine.BindingOps

RecBuilder Stream 
Instance details

Defined in Parsley.Internal.Backend.Machine.BindingOps

Methods

bindIterHandler# :: (Input# Stream -> StaHandler# s Stream a) -> (Code (Pos -> DynRep Stream -> Handler# s Stream a) -> Code b) -> Code b #

bindIter# :: Input# Stream -> (Code (Pos -> DynRep Stream -> ST s (Maybe a)) -> Input# Stream -> Code (ST s (Maybe a))) -> Code (ST s (Maybe a)) #

bindRec# :: (DynSubroutine s Stream a x -> StaSubroutine# s Stream a x) -> DynSubroutine s Stream a x #

InputPrep Stream 
Instance details

Defined in Parsley.Internal.Backend.Machine.InputOps

Methods

_prepare :: starep ~ StaRep Stream => Code Stream -> (InputOps starep -> starep -> Code r) -> Code r

LogOps (PartialStaOffWith Stream) 
Instance details

Defined in Parsley.Internal.Backend.Machine.InputOps