Copyright | (c) Sergey Vinokurov 2018 |
---|---|
License | Apache-2.0 (see LICENSE) |
Maintainer | serg.foo@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Node
- data Parser a
- runParser :: a -> (L a -> Parser b) -> Either (Doc Void) b
- mkTomlError :: L a -> Doc Void -> TomlError
- data AtomicTomlError
- = UnexpectedType !TomlType Node
- | MissingKey !Text Table
- | IndexOutOfBounds !Int Node
- | OtherError (Doc Void)
- data TomlError
- (<?>) :: L a -> Text -> L a
- data L a
- extract :: Comonad w => w a -> a
- class (Applicative m, Alternative m) => TomlParse m where
- throwParseError :: L b -> AtomicTomlError -> m a
- class FromToml a b where
- class Index a where
- (.!=) :: Functor m => m (Maybe a) -> a -> m a
- pTable :: TomlParse m => L Node -> m (L Table)
- pKey :: TomlParse m => Text -> L Table -> m (L Node)
- pKeyMaybe :: Text -> L Table -> L (Maybe Node)
- pStr :: TomlParse m => L Node -> m Text
- pStrL :: TomlParse m => L Node -> m (L Text)
- pBool :: TomlParse m => L Node -> m Bool
- pInt :: TomlParse m => L Node -> m Int
- pIntL :: TomlParse m => L Node -> m (L Int)
- pDouble :: TomlParse m => L Node -> m Double
- pDoubleL :: TomlParse m => L Node -> m (L Double)
- pDatetime :: TomlParse m => L Node -> m UTCTime
- pDatetimeL :: TomlParse m => L Node -> m (L UTCTime)
- pTArray :: TomlParse m => L Node -> m (Vector (L Table))
- pArray :: TomlParse m => L Node -> m (Vector (L Node))
- pCases :: (Ord k, FromToml Node k, Pretty k) => Map k v -> L Node -> Parser v
- ppToml :: Node -> Doc ann
Documentation
VTable Table | |
VTArray VTArray | |
VString Text | |
VInteger Int64 | |
VFloat Double | |
VBoolean Bool | |
VDatetime UTCTime | |
VArray VArray |
Instances
data AtomicTomlError Source #
UnexpectedType | |
| |
MissingKey !Text Table | |
IndexOutOfBounds !Int Node | |
OtherError (Doc Void) |
Instances
Show AtomicTomlError Source # | |
Defined in Data.Toml.Parse showsPrec :: Int -> AtomicTomlError -> ShowS # show :: AtomicTomlError -> String # showList :: [AtomicTomlError] -> ShowS # | |
Generic AtomicTomlError Source # | |
Defined in Data.Toml.Parse type Rep AtomicTomlError :: Type -> Type # from :: AtomicTomlError -> Rep AtomicTomlError x # to :: Rep AtomicTomlError x -> AtomicTomlError # | |
Pretty AtomicTomlError Source # | |
Defined in Data.Toml.Parse pretty :: AtomicTomlError -> Doc ann # prettyList :: [AtomicTomlError] -> Doc ann # | |
type Rep AtomicTomlError Source # | |
Defined in Data.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
.
Adds to a
its provenance in the toml file.
Instances
Functor L Source # | |
Foldable L Source # | |
Defined in Data.Toml.Parse 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 # elem :: Eq a => a -> L a -> Bool # maximum :: Ord a => L a -> a # | |
Traversable L Source # | |
Comonad L Source # | |
FromToml a (L a) Source # | |
Eq a => Eq (L a) Source # | |
Ord a => Ord (L a) Source # | |
Show a => Show (L a) Source # | |
Generic (L a) Source # | |
Pretty a => Pretty (L a) Source # | |
Defined in Data.Toml.Parse | |
Index (L Node) Source # | |
Index (L Table) Source # | |
type Rep (L a) Source # | |
Defined in Data.Toml.Parse |
class (Applicative m, Alternative m) => TomlParse m where Source #
throwParseError :: L b -> AtomicTomlError -> m a Source #
Instances
TomlParse Parser Source # | |
Defined in Data.Toml.Parse throwParseError :: L b -> AtomicTomlError -> Parser a Source # |
class FromToml a b where Source #
Instances
FromToml a a Source # | |
FromToml Node Bool Source # | |
FromToml Node Double Source # | |
FromToml Node Int Source # | |
FromToml Node String Source # | |
FromToml Node Text Source # | |
FromToml Node UTCTime Source # | |
FromToml a (L a) Source # | |
FromToml Node a => FromToml Node (NonEmpty a) Source # | |
FromToml Node a => FromToml Node (Vector a) Source # | |
(Ord k, FromToml Text k, FromToml Node v) => FromToml Node (Map k v) Source # | |
(Ord k, FromToml Text k, FromToml Node v) => FromToml Table (Map k v) Source # | |
(.:) :: FromToml Node b => a -> Text -> Parser b infixl 5 Source #
(.:?) :: FromToml Node b => a -> Text -> Parser (Maybe b) infixl 5 Source #