toml-reader-parse-0.1.1.1: Alternative parser for TOML values produced by the toml-reader package.
Copyright(c) Sergey Vinokurov 2018
LicenseApache-2.0 (see LICENSE)
Maintainerserg.foo@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

TOML.Parse

Description

 
Synopsis

Documentation

data Value #

Instances

Instances details
Show Value 
Instance details

Defined in TOML.Value

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

Eq Value 
Instance details

Defined in TOML.Value

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

DecodeTOML Value 
Instance details

Defined in TOML.Decode

FromToml Value Text Source # 
Instance details

Defined in TOML.Parse

FromToml Value String Source # 
Instance details

Defined in TOML.Parse

FromToml Value Bool Source # 
Instance details

Defined in TOML.Parse

FromToml Value Double Source # 
Instance details

Defined in TOML.Parse

FromToml Value Int Source # 
Instance details

Defined in TOML.Parse

FromToml Value a => FromToml Value (Vector a) Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L Value -> Parser (Vector a) Source #

FromToml Value a => FromToml Value (NonEmpty a) Source # 
Instance details

Defined in TOML.Parse

FromToml Value a => FromToml Value [a] Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L Value -> Parser [a] Source #

(Ord k, FromToml Text k, FromToml Value v) => FromToml Table (Map k v) Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L Table -> Parser (Map k v) Source #

(Ord k, FromToml Text k, FromToml Value v) => FromToml Value (Map k v) Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L Value -> Parser (Map k v) Source #

Index (L Table) Source # 
Instance details

Defined in TOML.Parse

Methods

(.:) :: FromToml Value b => L Table -> Text -> Parser b Source #

(.:?) :: FromToml Value b => L Table -> Text -> Parser (Maybe b) Source #

Index (L Value) Source # 
Instance details

Defined in TOML.Parse

Methods

(.:) :: FromToml Value b => L Value -> Text -> Parser b Source #

(.:?) :: FromToml Value b => L Value -> Text -> Parser (Maybe b) Source #

data Parser a Source #

Instances

Instances details
Alternative Parser Source # 
Instance details

Defined in TOML.Parse

Methods

empty :: Parser a #

(<|>) :: Parser a -> Parser a -> Parser a #

some :: Parser a -> Parser [a] #

many :: Parser a -> Parser [a] #

Applicative Parser Source # 
Instance details

Defined in TOML.Parse

Methods

pure :: a -> Parser a #

(<*>) :: Parser (a -> b) -> Parser a -> Parser b #

liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c #

(*>) :: Parser a -> Parser b -> Parser b #

(<*) :: Parser a -> Parser b -> Parser a #

Functor Parser Source # 
Instance details

Defined in TOML.Parse

Methods

fmap :: (a -> b) -> Parser a -> Parser b #

(<$) :: a -> Parser b -> Parser a #

Monad Parser Source # 
Instance details

Defined in TOML.Parse

Methods

(>>=) :: Parser a -> (a -> Parser b) -> Parser b #

(>>) :: Parser a -> Parser b -> Parser b #

return :: a -> Parser a #

MonadPlus Parser Source # 
Instance details

Defined in TOML.Parse

Methods

mzero :: Parser a #

mplus :: Parser a -> Parser a -> Parser a #

TomlParse Parser Source # 
Instance details

Defined in TOML.Parse

a ~ L Value => Index (Parser a) Source # 
Instance details

Defined in TOML.Parse

Methods

(.:) :: FromToml Value b => Parser a -> Text -> Parser b Source #

(.:?) :: FromToml Value b => Parser a -> Text -> Parser (Maybe b) Source #

runParser :: a -> (L a -> Parser b) -> Either (Doc Void) b Source #

data AtomicTomlError Source #

Constructors

UnexpectedType 

Fields

  • !TomlType

    Expected

  • Value

    Got

MissingKey !Text Table 
IndexOutOfBounds !Int Value 
OtherError (Doc Void) 

Instances

Instances details
Generic AtomicTomlError Source # 
Instance details

Defined in TOML.Parse

Associated Types

type Rep AtomicTomlError :: Type -> Type #

Show AtomicTomlError Source # 
Instance details

Defined in TOML.Parse

Pretty AtomicTomlError Source # 
Instance details

Defined in TOML.Parse

type Rep AtomicTomlError Source # 
Instance details

Defined in TOML.Parse

data TomlError Source #

Instances

Instances details
Generic TomlError Source # 
Instance details

Defined in TOML.Parse

Associated Types

type Rep TomlError :: Type -> Type #

Show TomlError Source # 
Instance details

Defined in TOML.Parse

Pretty TomlError Source # 
Instance details

Defined in TOML.Parse

Methods

pretty :: TomlError -> Doc ann #

prettyList :: [TomlError] -> Doc ann #

type Rep TomlError Source # 
Instance details

Defined in TOML.Parse

(<?>) :: L a -> Text -> L a infixl 9 Source #

Add textual annotation to the provided located thing. The annotation will be shows as part of error message if the location ultimately gets passed to throwParseError.

data L a Source #

Adds to a its provenance in the toml file.

Instances

Instances details
Foldable L Source # 
Instance details

Defined in TOML.Parse

Methods

fold :: Monoid m => L m -> m #

foldMap :: Monoid m => (a -> m) -> L a -> m #

foldMap' :: Monoid m => (a -> m) -> L a -> m #

foldr :: (a -> b -> b) -> b -> L a -> b #

foldr' :: (a -> b -> b) -> b -> L a -> b #

foldl :: (b -> a -> b) -> b -> L a -> b #

foldl' :: (b -> a -> b) -> b -> L a -> b #

foldr1 :: (a -> a -> a) -> L a -> a #

foldl1 :: (a -> a -> a) -> L a -> a #

toList :: L a -> [a] #

null :: L a -> Bool #

length :: L a -> Int #

elem :: Eq a => a -> L a -> Bool #

maximum :: Ord a => L a -> a #

minimum :: Ord a => L a -> a #

sum :: Num a => L a -> a #

product :: Num a => L a -> a #

Traversable L Source # 
Instance details

Defined in TOML.Parse

Methods

traverse :: Applicative f => (a -> f b) -> L a -> f (L b) #

sequenceA :: Applicative f => L (f a) -> f (L a) #

mapM :: Monad m => (a -> m b) -> L a -> m (L b) #

sequence :: Monad m => L (m a) -> m (L a) #

Functor L Source # 
Instance details

Defined in TOML.Parse

Methods

fmap :: (a -> b) -> L a -> L b #

(<$) :: a -> L b -> L a #

Comonad L Source # 
Instance details

Defined in TOML.Parse

Methods

extract :: L a -> a #

duplicate :: L a -> L (L a) #

extend :: (L a -> b) -> L a -> L b #

FromToml b a => FromToml b (L a) Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L b -> Parser (L a) Source #

Generic (L a) Source # 
Instance details

Defined in TOML.Parse

Associated Types

type Rep (L a) :: Type -> Type #

Methods

from :: L a -> Rep (L a) x #

to :: Rep (L a) x -> L a #

Show a => Show (L a) Source # 
Instance details

Defined in TOML.Parse

Methods

showsPrec :: Int -> L a -> ShowS #

show :: L a -> String #

showList :: [L a] -> ShowS #

Eq a => Eq (L a) Source # 
Instance details

Defined in TOML.Parse

Methods

(==) :: L a -> L a -> Bool #

(/=) :: L a -> L a -> Bool #

Ord a => Ord (L a) Source # 
Instance details

Defined in TOML.Parse

Methods

compare :: L a -> L a -> Ordering #

(<) :: L a -> L a -> Bool #

(<=) :: L a -> L a -> Bool #

(>) :: L a -> L a -> Bool #

(>=) :: L a -> L a -> Bool #

max :: L a -> L a -> L a #

min :: L a -> L a -> L a #

Pretty a => Pretty (L a) Source # 
Instance details

Defined in TOML.Parse

Methods

pretty :: L a -> Doc ann #

prettyList :: [L a] -> Doc ann #

Index (L Table) Source # 
Instance details

Defined in TOML.Parse

Methods

(.:) :: FromToml Value b => L Table -> Text -> Parser b Source #

(.:?) :: FromToml Value b => L Table -> Text -> Parser (Maybe b) Source #

Index (L Value) Source # 
Instance details

Defined in TOML.Parse

Methods

(.:) :: FromToml Value b => L Value -> Text -> Parser b Source #

(.:?) :: FromToml Value b => L Value -> Text -> Parser (Maybe b) Source #

type Rep (L a) Source # 
Instance details

Defined in TOML.Parse

type Rep (L a)

extract :: Comonad w => w a -> a #

extract . fmap f = f . extract

class (Applicative m, Alternative m) => TomlParse m where Source #

Methods

throwParseError :: L b -> AtomicTomlError -> m a Source #

Instances

Instances details
TomlParse Parser Source # 
Instance details

Defined in TOML.Parse

class FromToml a b where Source #

Methods

fromToml :: L a -> Parser b Source #

Instances

Instances details
FromToml Value Text Source # 
Instance details

Defined in TOML.Parse

FromToml Value String Source # 
Instance details

Defined in TOML.Parse

FromToml Value Bool Source # 
Instance details

Defined in TOML.Parse

FromToml Value Double Source # 
Instance details

Defined in TOML.Parse

FromToml Value Int Source # 
Instance details

Defined in TOML.Parse

FromToml a a Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L a -> Parser a Source #

FromToml Value a => FromToml Value (Vector a) Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L Value -> Parser (Vector a) Source #

FromToml Value a => FromToml Value (NonEmpty a) Source # 
Instance details

Defined in TOML.Parse

FromToml Value a => FromToml Value [a] Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L Value -> Parser [a] Source #

FromToml b a => FromToml b (L a) Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L b -> Parser (L a) Source #

(Ord k, FromToml Text k, FromToml Value v) => FromToml Table (Map k v) Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L Table -> Parser (Map k v) Source #

(Ord k, FromToml Text k, FromToml Value v) => FromToml Value (Map k v) Source # 
Instance details

Defined in TOML.Parse

Methods

fromToml :: L Value -> Parser (Map k v) Source #

class Index a where Source #

Methods

(.:) :: FromToml Value b => a -> Text -> Parser b infixl 5 Source #

(.:?) :: FromToml Value b => a -> Text -> Parser (Maybe b) infixl 5 Source #

Instances

Instances details
Index (L Table) Source # 
Instance details

Defined in TOML.Parse

Methods

(.:) :: FromToml Value b => L Table -> Text -> Parser b Source #

(.:?) :: FromToml Value b => L Table -> Text -> Parser (Maybe b) Source #

Index (L Value) Source # 
Instance details

Defined in TOML.Parse

Methods

(.:) :: FromToml Value b => L Value -> Text -> Parser b Source #

(.:?) :: FromToml Value b => L Value -> Text -> Parser (Maybe b) Source #

a ~ L Value => Index (Parser a) Source # 
Instance details

Defined in TOML.Parse

Methods

(.:) :: FromToml Value b => Parser a -> Text -> Parser b Source #

(.:?) :: FromToml Value b => Parser a -> Text -> Parser (Maybe b) Source #

(.!=) :: Functor m => m (Maybe a) -> a -> m a infixl 5 Source #

Assign default value to a parser that produces Maybe. Typically used together with .:?:

foo .:? "bar" .!= 10

pKey :: TomlParse m => Text -> L Table -> m (L Value) Source #

pStrL :: TomlParse m => L Value -> m (L Text) Source #

pIntL :: TomlParse m => L Value -> m (L Int) Source #

data TomlDateTime Source #

Instances

Instances details
Generic TomlDateTime Source # 
Instance details

Defined in TOML.Parse

Associated Types

type Rep TomlDateTime :: Type -> Type #

Show TomlDateTime Source # 
Instance details

Defined in TOML.Parse

NFData TomlDateTime Source # 
Instance details

Defined in TOML.Parse

Methods

rnf :: TomlDateTime -> () #

Eq TomlDateTime Source # 
Instance details

Defined in TOML.Parse

Ord TomlDateTime Source # 
Instance details

Defined in TOML.Parse

Pretty TomlDateTime Source # 
Instance details

Defined in TOML.Parse

Methods

pretty :: TomlDateTime -> Doc ann #

prettyList :: [TomlDateTime] -> Doc ann #

type Rep TomlDateTime Source # 
Instance details

Defined in TOML.Parse

pCases :: (Ord k, FromToml Value k, Pretty k) => Map k v -> L Value -> Parser v Source #

ppToml :: Value -> Doc ann Source #

Prettyprint toml value.