text-2.1.5: An efficient packed Unicode text type.
Copyright(c) 2014 Bryan O'Sullivan
LicenseBSD-style
Maintainerbos@serpentine.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Text.Internal.Read

Description

Common internal functions for reading textual data.

Synopsis

Documentation

type IReader t a = t -> Either String (a, t) Source #

newtype IParser t a Source #

Constructors

P 

Fields

Instances

Instances details
Applicative (IParser t) Source # 
Instance details

Defined in Data.Text.Internal.Read

Methods

pure :: a -> IParser t a #

(<*>) :: IParser t (a -> b) -> IParser t a -> IParser t b #

liftA2 :: (a -> b -> c) -> IParser t a -> IParser t b -> IParser t c #

(*>) :: IParser t a -> IParser t b -> IParser t b #

(<*) :: IParser t a -> IParser t b -> IParser t a #

Functor (IParser t) Source # 
Instance details

Defined in Data.Text.Internal.Read

Methods

fmap :: (a -> b) -> IParser t a -> IParser t b #

(<$) :: a -> IParser t b -> IParser t a #

Monad (IParser t) Source # 
Instance details

Defined in Data.Text.Internal.Read

Methods

(>>=) :: IParser t a -> (a -> IParser t b) -> IParser t b #

(>>) :: IParser t a -> IParser t b -> IParser t b #

return :: a -> IParser t a #

data T Source #

Constructors

T !Integer !Int 

maxExponentDigits :: Int Source #

The number of digits that always fit in an Int. An exponent with more significant digits is out of range.

perhaps :: a -> IParser t a -> IParser t a Source #

catchOrBind :: IParser t a -> IParser t b -> (a -> IParser t b) -> IParser t b Source #

catchOrBind p q k runs p; if it fails, runs q on the same input instead, and otherwise continues with k, whose failures are not caught.

snapshot :: IParser t t Source #

The remaining input, to go back to with reset.

reset :: t -> a -> IParser t a Source #