Copyright | (c) Sergey Vinokurov 2018 |
---|---|
License | Apache-2.0 (see LICENSE) |
Maintainer | serg.foo@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data Value
- data Parser a
- runParser :: a -> (L a -> Parser b) -> Either (Doc Void) b
- mkTomlError :: L a -> Doc Void -> TomlError
- data AtomicTomlError
- = UnexpectedType !TomlType Value
- | MissingKey !Text Table
- | IndexOutOfBounds !Int Value
- | 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 Value -> m Table
- pTableL :: TomlParse m => L Value -> m (L Table)
- pKey :: TomlParse m => Text -> L Table -> m (L Value)
- pKeyMaybe :: Text -> L Table -> L (Maybe Value)
- pStr :: TomlParse m => L Value -> m Text
- pStrL :: TomlParse m => L Value -> m (L Text)
- pBool :: TomlParse m => L Value -> m Bool
- pInt :: TomlParse m => L Value -> m Int
- pIntL :: TomlParse m => L Value -> m (L Int)
- pDouble :: TomlParse m => L Value -> m Double
- pDoubleL :: TomlParse m => L Value -> m (L Double)
- pArray :: TomlParse m => L Value -> m [L Value]
- data TomlDateTime
- pDatetime :: TomlParse m => L Value -> m TomlDateTime
- pDatetimeL :: TomlParse m => L Value -> m (L TomlDateTime)
- pCases :: (Ord k, FromToml Value k, Pretty k) => Map k v -> L Value -> Parser v
- ppToml :: Value -> Doc ann
Documentation
Table Table | |
Array [Value] | |
String Text | |
Integer Integer | |
Float Double | |
Boolean Bool | |
OffsetDateTime (LocalTime, TimeZone) | |
LocalDateTime LocalTime | |
LocalDate Day | |
LocalTime TimeOfDay |
Instances
Show Value | |
Eq Value | |
DecodeTOML Value | |
Defined in TOML.Decode tomlDecoder :: Decoder Value # | |
FromToml Value Text Source # | |
FromToml Value String Source # | |
FromToml Value Bool Source # | |
FromToml Value Double Source # | |
FromToml Value Int Source # | |
FromToml Value a => FromToml Value (Vector a) Source # | |
FromToml Value a => FromToml Value (NonEmpty a) Source # | |
FromToml Value a => FromToml Value [a] Source # | |
(Ord k, FromToml Text k, FromToml Value v) => FromToml Table (Map k v) Source # | |
(Ord k, FromToml Text k, FromToml Value v) => FromToml Value (Map k v) Source # | |
Index (L Table) Source # | |
Index (L Value) Source # | |
data AtomicTomlError Source #
UnexpectedType | |
| |
MissingKey !Text Table | |
IndexOutOfBounds !Int Value | |
OtherError (Doc Void) |
Instances
Generic AtomicTomlError Source # | |
Defined in TOML.Parse type Rep AtomicTomlError :: Type -> Type # from :: AtomicTomlError -> Rep AtomicTomlError x # to :: Rep AtomicTomlError x -> AtomicTomlError # | |
Show AtomicTomlError Source # | |
Defined in TOML.Parse showsPrec :: Int -> AtomicTomlError -> ShowS # show :: AtomicTomlError -> String # showList :: [AtomicTomlError] -> ShowS # | |
Pretty AtomicTomlError Source # | |
Defined in TOML.Parse pretty :: AtomicTomlError -> Doc ann # prettyList :: [AtomicTomlError] -> Doc ann # | |
type Rep AtomicTomlError Source # | |
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
.
Adds to a
its provenance in the toml file.
Instances
Foldable L Source # | |
Defined in 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 # | |
Functor L Source # | |
Comonad L Source # | |
FromToml b a => FromToml b (L a) Source # | |
Generic (L a) Source # | |
Show a => Show (L a) Source # | |
Eq a => Eq (L a) Source # | |
Ord a => Ord (L a) Source # | |
Pretty a => Pretty (L a) Source # | |
Defined in TOML.Parse | |
Index (L Table) Source # | |
Index (L Value) Source # | |
type Rep (L a) Source # | |
Defined in TOML.Parse |
class (Applicative m, Alternative m) => TomlParse m where Source #
throwParseError :: L b -> AtomicTomlError -> m a Source #
Instances
TomlParse Parser Source # | |
Defined in TOML.Parse throwParseError :: L b -> AtomicTomlError -> Parser a Source # |
class FromToml a b where Source #
Instances
FromToml Value Text Source # | |
FromToml Value String Source # | |
FromToml Value Bool Source # | |
FromToml Value Double Source # | |
FromToml Value Int Source # | |
FromToml a a Source # | |
FromToml Value a => FromToml Value (Vector a) Source # | |
FromToml Value a => FromToml Value (NonEmpty a) Source # | |
FromToml Value a => FromToml Value [a] Source # | |
FromToml b a => FromToml b (L a) Source # | |
(Ord k, FromToml Text k, FromToml Value v) => FromToml Table (Map k v) Source # | |
(Ord k, FromToml Text k, FromToml Value v) => FromToml Value (Map k v) Source # | |
(.:) :: FromToml Value b => a -> Text -> Parser b infixl 5 Source #
(.:?) :: FromToml Value b => a -> Text -> Parser (Maybe b) infixl 5 Source #
data TomlDateTime Source #
TomlLocalDateTime LocalTime | |
TomlOffsetDateTime (LocalTime, TimeZone) | |
TomlLocalDate Day | |
TomlLocalTime TimeOfDay |
Instances
pDatetimeL :: TomlParse m => L Value -> m (L TomlDateTime) Source #