json-0.11: Support for serialising Haskell to and from JSON
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.JSON.Parsec

Description

Parse JSON values using the Parsec combinators.

Documentation

p_object :: CharParser () [(String, JSValue)] Source #

p_number :: CharParser () Rational Source #

label :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> String -> ParsecT s u m a #

token :: Stream s Identity t => (t -> String) -> (t -> SourcePos) -> (t -> Maybe a) -> Parsec s u a #

data State s u #

Constructors

State 

Fields

(<|>) :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a #

many :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m [a] #

optional :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m () #

choice :: forall s (m :: Type -> Type) t u a. Stream s m t => [ParsecT s u m a] -> ParsecT s u m a #

char :: forall s (m :: Type -> Type) u. Stream s m Char => Char -> ParsecT s u m Char #

satisfy :: forall s (m :: Type -> Type) u. Stream s m Char => (Char -> Bool) -> ParsecT s u m Char #

string :: forall s (m :: Type -> Type) u. Stream s m Char => String -> ParsecT s u m String #

between :: forall s (m :: Type -> Type) t u open close a. Stream s m t => ParsecT s u m open -> ParsecT s u m close -> ParsecT s u m a -> ParsecT s u m a #

chainl :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m (a -> a -> a) -> a -> ParsecT s u m a #

chainl1 :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m (a -> a -> a) -> ParsecT s u m a #

chainr :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m (a -> a -> a) -> a -> ParsecT s u m a #

chainr1 :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m (a -> a -> a) -> ParsecT s u m a #

count :: forall s (m :: Type -> Type) t u a. Stream s m t => Int -> ParsecT s u m a -> ParsecT s u m [a] #

endBy :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] #

endBy1 :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] #

eof :: forall s (m :: Type -> Type) t u. (Stream s m t, Show t) => ParsecT s u m () #

many1 :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m [a] #

manyTill :: forall s (m :: Type -> Type) t u a end. Stream s m t => ParsecT s u m a -> ParsecT s u m end -> ParsecT s u m [a] #

option :: forall s (m :: Type -> Type) t a u. Stream s m t => a -> ParsecT s u m a -> ParsecT s u m a #

sepBy :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] #

sepBy1 :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] #

skipMany :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m () #

skipMany1 :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m () #

getInput :: forall (m :: Type -> Type) s u. Monad m => ParsecT s u m s #

setInput :: forall (m :: Type -> Type) s u. Monad m => s -> ParsecT s u m () #

parse :: Stream s Identity t => Parsec s () a -> SourceName -> s -> Either ParseError a #

space :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

type CharParser st = GenParser Char st #

spaces :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m () #

(<?>) :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> String -> ParsecT s u m a #

alphaNum :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

anyChar :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

digit :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

hexDigit :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

letter :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

lower :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

newline :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

noneOf :: forall s (m :: Type -> Type) u. Stream s m Char => [Char] -> ParsecT s u m Char #

octDigit :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

oneOf :: forall s (m :: Type -> Type) u. Stream s m Char => [Char] -> ParsecT s u m Char #

tab :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

upper :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char #

anyToken :: forall s (m :: Type -> Type) t u. (Stream s m t, Show t) => ParsecT s u m t #

notFollowedBy :: forall s (m :: Type -> Type) t a u. (Stream s m t, Show a) => ParsecT s u m a -> ParsecT s u m () #

optionMaybe :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m (Maybe a) #

sepEndBy :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] #

sepEndBy1 :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] #

data ParseError #

Instances

Instances details
Exception ParseError 
Instance details

Defined in Text.Parsec.Error

Methods

toException :: ParseError -> SomeException

fromException :: SomeException -> Maybe ParseError

displayException :: ParseError -> String

Show ParseError 
Instance details

Defined in Text.Parsec.Error

Methods

showsPrec :: Int -> ParseError -> ShowS

show :: ParseError -> String

showList :: [ParseError] -> ShowS

Eq ParseError 
Instance details

Defined in Text.Parsec.Error

Methods

(==) :: ParseError -> ParseError -> Bool

(/=) :: ParseError -> ParseError -> Bool

type Column = Int #

type Line = Int #

type SourceName = String #

data SourcePos #

Instances

Instances details
Data SourcePos 
Instance details

Defined in Text.Parsec.Pos

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourcePos -> c SourcePos

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourcePos

toConstr :: SourcePos -> Constr

dataTypeOf :: SourcePos -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourcePos)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourcePos)

gmapT :: (forall b. Data b => b -> b) -> SourcePos -> SourcePos

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r

gmapQ :: (forall d. Data d => d -> u) -> SourcePos -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourcePos -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos

Show SourcePos 
Instance details

Defined in Text.Parsec.Pos

Methods

showsPrec :: Int -> SourcePos -> ShowS

show :: SourcePos -> String

showList :: [SourcePos] -> ShowS

Eq SourcePos 
Instance details

Defined in Text.Parsec.Pos

Methods

(==) :: SourcePos -> SourcePos -> Bool

(/=) :: SourcePos -> SourcePos -> Bool

Ord SourcePos 
Instance details

Defined in Text.Parsec.Pos

Methods

compare :: SourcePos -> SourcePos -> Ordering

(<) :: SourcePos -> SourcePos -> Bool

(<=) :: SourcePos -> SourcePos -> Bool

(>) :: SourcePos -> SourcePos -> Bool

(>=) :: SourcePos -> SourcePos -> Bool

max :: SourcePos -> SourcePos -> SourcePos

min :: SourcePos -> SourcePos -> SourcePos

getParserState :: forall (m :: Type -> Type) s u. Monad m => ParsecT s u m (State s u) #

getPosition :: forall (m :: Type -> Type) s u. Monad m => ParsecT s u m SourcePos #

getState :: forall (m :: Type -> Type) s u. Monad m => ParsecT s u m u #

labels :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> [String] -> ParsecT s u m a #

lookAhead :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m a #

parseTest :: (Stream s Identity t, Show a) => Parsec s () a -> s -> IO () #

setParserState :: forall (m :: Type -> Type) s u. Monad m => State s u -> ParsecT s u m (State s u) #

setPosition :: forall (m :: Type -> Type) s u. Monad m => SourcePos -> ParsecT s u m () #

setState :: forall (m :: Type -> Type) u s. Monad m => u -> ParsecT s u m () #

tokenPrim :: forall s (m :: Type -> Type) t a u. Stream s m t => (t -> String) -> (SourcePos -> t -> s -> SourcePos) -> (t -> Maybe a) -> ParsecT s u m a #

tokenPrimEx :: forall s (m :: Type -> Type) t u a. Stream s m t => (t -> String) -> (SourcePos -> t -> s -> SourcePos) -> Maybe (SourcePos -> t -> s -> u -> u) -> (t -> Maybe a) -> ParsecT s u m a #

tokens :: forall s (m :: Type -> Type) t u. (Stream s m t, Eq t) => ([t] -> String) -> (SourcePos -> [t] -> SourcePos) -> [t] -> ParsecT s u m [t] #

unexpected :: forall s (m :: Type -> Type) t u a. Stream s m t => String -> ParsecT s u m a #

updateState :: forall (m :: Type -> Type) u s. Monad m => (u -> u) -> ParsecT s u m () #

type GenParser tok st = Parsec [tok] st #

type Parser = Parsec String () #

parseFromFile :: Parser a -> FilePath -> IO (Either ParseError a) #

pzero :: GenParser tok st a #

runParser :: GenParser tok st a -> st -> SourceName -> [tok] -> Either ParseError a #

try :: GenParser tok st a -> GenParser tok st a #