Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Text.JSON.Parsec
Description
Parse JSON values using the Parsec combinators.
Documentation
p_value :: CharParser () JSValue Source #
p_null :: CharParser () () Source #
p_boolean :: CharParser () Bool Source #
p_array :: CharParser () [JSValue] Source #
p_string :: CharParser () String Source #
p_object :: CharParser () [(String, JSValue)] Source #
p_number :: CharParser () Rational Source #
p_js_string :: CharParser () JSString Source #
p_js_object :: CharParser () (JSObject JSValue) Source #
p_jvalue :: CharParser () JSValue Source #
token :: Stream s Identity t => (t -> String) -> (t -> SourcePos) -> (t -> Maybe a) -> Parsec s u 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 #
satisfy :: forall s (m :: Type -> Type) u. Stream s m Char => (Char -> Bool) -> ParsecT s u m Char #
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] #
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] #
skipMany1 :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m () #
parse :: Stream s Identity t => Parsec s () a -> SourceName -> s -> Either ParseError a #
type CharParser st = GenParser Char st #
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
Exception ParseError | |
Defined in Text.Parsec.Error Methods toException :: ParseError -> SomeException fromException :: SomeException -> Maybe ParseError displayException :: ParseError -> String | |
Show ParseError | |
Defined in Text.Parsec.Error Methods showsPrec :: Int -> ParseError -> ShowS show :: ParseError -> String showList :: [ParseError] -> ShowS | |
Eq ParseError | |
Defined in Text.Parsec.Error |
errorPos :: ParseError -> SourcePos #
type SourceName = String #
Instances
Data SourcePos | |
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 | |
Eq SourcePos | |
Ord SourcePos | |
Defined in Text.Parsec.Pos |
incSourceColumn :: SourcePos -> Column -> SourcePos #
incSourceLine :: SourcePos -> Line -> SourcePos #
setSourceColumn :: SourcePos -> Column -> SourcePos #
setSourceLine :: SourcePos -> Line -> SourcePos #
setSourceName :: SourcePos -> SourceName -> SourcePos #
sourceColumn :: SourcePos -> Column #
sourceLine :: SourcePos -> Line #
sourceName :: SourcePos -> SourceName #
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 #
lookAhead :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m a #
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 () #
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 () #
parseFromFile :: Parser a -> FilePath -> IO (Either ParseError a) #
runParser :: GenParser tok st a -> st -> SourceName -> [tok] -> Either ParseError a #