-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | TOML 1.0.0 parser -- -- TOML parser using generated lexers and parsers with careful attention -- to the TOML 1.0.0 semantics for defining tables. @package toml-parser @version 1.3.0.0 -- | This type helps to build up computations that can validate a TOML -- value and compute some application-specific representation. -- -- It supports warning messages which can be used to deprecate old -- configuration options and to detect unused table keys. -- -- It supports tracking multiple error messages when you have more than -- one decoding option and all of them have failed. -- -- Use prettyMatchMessage for an easy way to make human readable -- strings from matcher outputs. module Toml.FromValue.Matcher -- | Computations that result in a Result and which track a list of -- nested contexts to assist in generating warnings and error messages. -- -- Use withScope to run a Matcher in a new, nested scope. data Matcher a -- | Computation outcome with error and warning messages. Multiple error -- messages can occur when multiple alternatives all fail. Resolving any -- one of the error messages could allow the computation to succeed. data Result e a -- | error messages Failure :: [e] -> Result e a -- | warning messages and result Success :: [e] -> a -> Result e a -- | A message emitted while matching a TOML value. The message is paired -- with the path to the value that was in focus when the message was -- generated. These message get used for both warnings and errors. data MatchMessage MatchMessage :: [Scope] -> String -> MatchMessage -- | path to message location [matchPath] :: MatchMessage -> [Scope] -- | error and warning message body [matchMessage] :: MatchMessage -> String -- | Run a Matcher with an empty scope. runMatcher :: Matcher a -> Result MatchMessage a -- | Run a Matcher with a locally extended scope. withScope :: Scope -> Matcher a -> Matcher a -- | Get the current list of scopes. getScope :: Matcher [Scope] -- | Emit a warning mentioning the current scope. warning :: String -> Matcher () -- | Scopes for TOML message. data Scope -- | zero-based array index ScopeIndex :: Int -> Scope -- | key in a table ScopeKey :: String -> Scope -- | Update the scope with the message corresponding to a table key inKey :: String -> Matcher a -> Matcher a -- | Update the scope with the message corresponding to an array index inIndex :: Int -> Matcher a -> Matcher a instance GHC.Classes.Ord Toml.FromValue.Matcher.Scope instance GHC.Classes.Eq Toml.FromValue.Matcher.Scope instance GHC.Show.Show Toml.FromValue.Matcher.Scope instance GHC.Read.Read Toml.FromValue.Matcher.Scope instance GHC.Classes.Ord Toml.FromValue.Matcher.MatchMessage instance GHC.Classes.Eq Toml.FromValue.Matcher.MatchMessage instance GHC.Show.Show Toml.FromValue.Matcher.MatchMessage instance GHC.Read.Read Toml.FromValue.Matcher.MatchMessage instance GHC.Base.Monoid (Toml.FromValue.Matcher.DList a) instance GHC.Base.Semigroup (Toml.FromValue.Matcher.DList a) instance GHC.Base.MonadPlus Toml.FromValue.Matcher.Matcher instance GHC.Base.Alternative Toml.FromValue.Matcher.Matcher instance GHC.Base.Monad Toml.FromValue.Matcher.Matcher instance GHC.Base.Applicative Toml.FromValue.Matcher.Matcher instance GHC.Base.Functor Toml.FromValue.Matcher.Matcher instance (GHC.Classes.Ord e, GHC.Classes.Ord a) => GHC.Classes.Ord (Toml.FromValue.Matcher.Result e a) instance (GHC.Classes.Eq e, GHC.Classes.Eq a) => GHC.Classes.Eq (Toml.FromValue.Matcher.Result e a) instance (GHC.Show.Show e, GHC.Show.Show a) => GHC.Show.Show (Toml.FromValue.Matcher.Result e a) instance (GHC.Read.Read e, GHC.Read.Read a) => GHC.Read.Read (Toml.FromValue.Matcher.Result e a) instance Control.Monad.Fail.MonadFail Toml.FromValue.Matcher.Matcher -- | This module provides the datatype for the lexical syntax of TOML -- files. These tokens are generated by Toml.Lexer and consumed in -- Toml.Parser. module Toml.Lexer.Token -- | Lexical token data Token -- |
-- true --TokTrue :: Token -- |
-- false --TokFalse :: Token -- |
-- ',' --TokComma :: Token -- |
-- '=' --TokEquals :: Token -- |
-- end-of-line --TokNewline :: Token -- |
-- . --TokPeriod :: Token -- |
-- '[' --TokSquareO :: Token -- |
-- ']' --TokSquareC :: Token -- |
-- '[[' --Tok2SquareO :: Token -- |
-- ']]' --Tok2SquareC :: Token -- |
-- '{'
--
TokCurlyO :: Token
-- | -- '}' --TokCurlyC :: Token -- | bare key TokBareKey :: String -> Token -- | string literal TokString :: String -> Token -- | multiline string literal TokMlString :: String -> Token -- | integer literal TokInteger :: !Integer -> Token -- | floating-point literal TokFloat :: !Double -> Token -- | date-time with timezone offset TokOffsetDateTime :: !ZonedTime -> Token -- | local date-time TokLocalDateTime :: !LocalTime -> Token -- | local date TokLocalDate :: !Day -> Token -- | local time TokLocalTime :: !TimeOfDay -> Token -- |
-- end-of-input --TokEOF :: Token -- | Construct a TokInteger from a binary integer literal lexeme. mkBinInteger :: String -> Token -- | Construct a TokInteger from a decimal integer literal lexeme. mkDecInteger :: String -> Token -- | Construct a TokInteger from a octal integer literal lexeme. mkOctInteger :: String -> Token -- | Construct a TokInteger from a hexadecimal integer literal -- lexeme. mkHexInteger :: String -> Token -- | Construct a TokFloat from a floating-point literal lexeme. mkFloat :: String -> Token -- | Format strings for local date lexemes. localDatePatterns :: [String] -- | Format strings for local time lexemes. localTimePatterns :: [String] -- | Format strings for local datetime lexemes. localDateTimePatterns :: [String] -- | Format strings for offset datetime lexemes. offsetDateTimePatterns :: [String] instance GHC.Show.Show Toml.Lexer.Token.Token instance GHC.Read.Read Toml.Lexer.Token.Token -- | This module provides the Position type for tracking locations -- in files while doing lexing and parsing for providing more useful -- error messages. -- -- This module assumes 8 column wide tab stops. module Toml.Position -- | A position in a text file data Position Position :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> Position -- | code-point index (zero-based) [posIndex] :: Position -> {-# UNPACK #-} !Int -- | line index (one-based) [posLine] :: Position -> {-# UNPACK #-} !Int -- | column index (one-based) [posColumn] :: Position -> {-# UNPACK #-} !Int -- | The initial Position for the start of a file startPos :: Position -- | Adjust a file position given a single character handling newlines and -- tabs. All other characters are considered to fill exactly one column. move :: Char -> Position -> Position instance GHC.Classes.Eq Toml.Position.Position instance GHC.Classes.Ord Toml.Position.Position instance GHC.Show.Show Toml.Position.Position instance GHC.Read.Read Toml.Position.Position -- | This module provides a simple tuple for tracking pairs of values and -- their file locations. module Toml.Located -- | A value annotated with its text file position data Located a Located :: {-# UNPACK #-} !Position -> !a -> Located a -- | position [locPosition] :: Located a -> {-# UNPACK #-} !Position -- | thing at position [locThing] :: Located a -> !a instance Data.Traversable.Traversable Toml.Located.Located instance Data.Foldable.Foldable Toml.Located.Located instance GHC.Base.Functor Toml.Located.Located instance GHC.Show.Show a => GHC.Show.Show (Toml.Located.Located a) instance GHC.Read.Read a => GHC.Read.Read (Toml.Located.Located a) -- | This module provides a raw representation of TOML files as a list of -- table definitions and key-value assignments. -- -- These values use the raw dotted keys and have no detection for -- overlapping assignments. -- -- Further processing will happen in the Semantics module. module Toml.Parser.Types -- | Non-empty sequence of dotted simple keys type Key = NonEmpty (Located String) -- | Headers and assignments corresponding to lines of a TOML file data Expr -- | key value assignment: key = value KeyValExpr :: Key -> Val -> Expr -- | table: [key] TableExpr :: Key -> Expr -- | array of tables: [[key]] ArrayTableExpr :: Key -> Expr -- | Unvalidated TOML values. Table are represented as a list of -- assignments rather than as resolved maps. data Val ValInteger :: Integer -> Val ValFloat :: Double -> Val ValArray :: [Val] -> Val ValTable :: [(Key, Val)] -> Val ValBool :: Bool -> Val ValString :: String -> Val ValTimeOfDay :: TimeOfDay -> Val ValZonedTime :: ZonedTime -> Val ValLocalTime :: LocalTime -> Val ValDay :: Day -> Val -- | Kinds of table headers. data SectionKind -- |
-- true --TokTrue :: Token -- |
-- false --TokFalse :: Token -- |
-- ',' --TokComma :: Token -- |
-- '=' --TokEquals :: Token -- |
-- end-of-line --TokNewline :: Token -- |
-- . --TokPeriod :: Token -- |
-- '[' --TokSquareO :: Token -- |
-- ']' --TokSquareC :: Token -- |
-- '[[' --Tok2SquareO :: Token -- |
-- ']]' --Tok2SquareC :: Token -- |
-- '{'
--
TokCurlyO :: Token
-- | -- '}' --TokCurlyC :: Token -- | bare key TokBareKey :: String -> Token -- | string literal TokString :: String -> Token -- | multiline string literal TokMlString :: String -> Token -- | integer literal TokInteger :: !Integer -> Token -- | floating-point literal TokFloat :: !Double -> Token -- | date-time with timezone offset TokOffsetDateTime :: !ZonedTime -> Token -- | local date-time TokLocalDateTime :: !LocalTime -> Token -- | local date TokLocalDate :: !Day -> Token -- | local time TokLocalTime :: !TimeOfDay -> Token -- |
-- end-of-input --TokEOF :: Token -- | This module provides the type for the semantics of a TOML file. All -- dotted keys are resolved in this representation. Each table is a Map -- with a single level of keys. module Toml.Value -- | Semantic TOML value with all table assignments resolved. data Value Integer :: Integer -> Value Float :: Double -> Value Array :: [Value] -> Value Table :: Table -> Value Bool :: Bool -> Value String :: String -> Value TimeOfDay :: TimeOfDay -> Value ZonedTime :: ZonedTime -> Value LocalTime :: LocalTime -> Value Day :: Day -> Value -- | Representation of a TOML key-value table. type Table = Map String Value instance GHC.Generics.Generic Toml.Value.Value instance Data.Data.Data Toml.Value.Value instance GHC.Read.Read Toml.Value.Value instance GHC.Show.Show Toml.Value.Value instance GHC.Classes.Eq Toml.Value.Value -- | The ToValue class provides a conversion function from -- application-specific to TOML values. -- -- Because the top-level TOML document is always a table, the -- ToTable class is for types that specifically support conversion -- from a Table. -- -- Toml.ToValue.Generic can be used to derive instances of -- ToTable automatically for record types. module Toml.ToValue -- | Class for types that can be embedded into Value class ToValue a -- | Embed a single thing into a TOML value. toValue :: ToValue a => a -> Value -- | Helper for converting a list of things into a value. This is typically -- left to be defined by its default implementation and exists to help -- define the encoding for TOML arrays. toValueList :: ToValue a => [a] -> Value -- | Class for things that can be embedded into a TOML table. -- -- Implement this for things that embed into a Table and then the -- ToValue instance can be derived with -- defaultTableToValue. class ToValue a => ToTable a -- | Convert a single value into a table toTable :: ToTable a => a -> Table -- | Convert to a table key class ToKey a toKey :: ToKey a => a -> String -- | Convenience function for building ToValue instances. defaultTableToValue :: ToTable a => a -> Value -- | Build a Table from a list of key-value pairs. -- -- Use .= for a convenient way to build the pairs. table :: [(String, Value)] -> Table -- | Convenience function for building key-value pairs while constructing a -- Table. -- --
-- table [a .= b, c .= d] --(.=) :: ToValue a => String -> a -> (String, Value) instance (Toml.ToValue.ToKey k, Toml.ToValue.ToValue v) => Toml.ToValue.ToTable (Data.Map.Internal.Map k v) instance (Toml.ToValue.ToKey k, Toml.ToValue.ToValue v) => Toml.ToValue.ToValue (Data.Map.Internal.Map k v) instance (GHC.Types.Char GHC.Types.~ a) => Toml.ToValue.ToKey [a] instance Toml.ToValue.ToKey Data.Text.Internal.Text instance Toml.ToValue.ToKey Data.Text.Internal.Lazy.Text instance Toml.ToValue.ToValue Toml.Value.Value instance Toml.ToValue.ToValue GHC.Types.Char instance Toml.ToValue.ToValue Data.Text.Internal.Text instance Toml.ToValue.ToValue Data.Text.Internal.Lazy.Text instance Toml.ToValue.ToValue a => Toml.ToValue.ToValue [a] instance Toml.ToValue.ToValue a => Toml.ToValue.ToValue (GHC.Base.NonEmpty a) instance Toml.ToValue.ToValue a => Toml.ToValue.ToValue (Data.Sequence.Internal.Seq a) instance GHC.Real.Integral a => Toml.ToValue.ToValue (GHC.Real.Ratio a) instance Toml.ToValue.ToValue GHC.Types.Double instance Toml.ToValue.ToValue GHC.Types.Float instance Toml.ToValue.ToValue GHC.Types.Bool instance Toml.ToValue.ToValue Data.Time.LocalTime.Internal.TimeOfDay.TimeOfDay instance Toml.ToValue.ToValue Data.Time.LocalTime.Internal.LocalTime.LocalTime instance Toml.ToValue.ToValue Data.Time.LocalTime.Internal.ZonedTime.ZonedTime instance Toml.ToValue.ToValue Data.Time.Calendar.Days.Day instance Toml.ToValue.ToValue GHC.Num.Integer.Integer instance Toml.ToValue.ToValue GHC.Num.Natural.Natural instance Toml.ToValue.ToValue GHC.Types.Int instance Toml.ToValue.ToValue GHC.Int.Int8 instance Toml.ToValue.ToValue GHC.Int.Int16 instance Toml.ToValue.ToValue GHC.Int.Int32 instance Toml.ToValue.ToValue GHC.Int.Int64 instance Toml.ToValue.ToValue GHC.Types.Word instance Toml.ToValue.ToValue GHC.Word.Word8 instance Toml.ToValue.ToValue GHC.Word.Word16 instance Toml.ToValue.ToValue GHC.Word.Word32 instance Toml.ToValue.ToValue GHC.Word.Word64 -- | Use genericToTable to derive an instance of ToTable -- using the field names of a record. module Toml.ToValue.Generic -- | Supports conversion of product types with field selector names to TOML -- values. class GToTable f gToTable :: GToTable f => f a -> Table -- | Use a record's field names to generate a Table genericToTable :: (Generic a, GToTable (Rep a)) => a -> Table instance Toml.ToValue.Generic.GToTable f => Toml.ToValue.Generic.GToTable (GHC.Generics.D1 c f) instance Toml.ToValue.Generic.GToTable f => Toml.ToValue.Generic.GToTable (GHC.Generics.C1 c f) instance (Toml.ToValue.Generic.GToTable f, Toml.ToValue.Generic.GToTable g) => Toml.ToValue.Generic.GToTable (f GHC.Generics.:*: g) instance (GHC.Generics.Selector s, Toml.ToValue.ToValue a) => Toml.ToValue.Generic.GToTable (GHC.Generics.S1 s (GHC.Generics.K1 i (GHC.Maybe.Maybe a))) instance (GHC.Generics.Selector s, Toml.ToValue.ToValue a) => Toml.ToValue.Generic.GToTable (GHC.Generics.S1 s (GHC.Generics.K1 i a)) instance Toml.ToValue.Generic.GToTable GHC.Generics.U1 instance Toml.ToValue.Generic.GToTable GHC.Generics.V1 -- | This module extracts the nested Map representation of a TOML file. It -- detects invalid key assignments and resolves dotted key assignments. module Toml.Semantics -- | The type of errors that can be generated when resolving all the key -- used in a TOML document. These errors always pertain to some key to -- caused one of three conflicts. data SemanticError SemanticError :: String -> SemanticErrorKind -> SemanticError [errorKey] :: SemanticError -> String [errorKind] :: SemanticError -> SemanticErrorKind -- | Enumeration of the kinds of conflicts a key can generate. data SemanticErrorKind -- | Attempted to assign to a key that was already assigned AlreadyAssigned :: SemanticErrorKind -- | Attempted to open a table already closed ClosedTable :: SemanticErrorKind -- | Attempted to open a tables as an array of tables that was implicitly -- defined to be a table ImplicitlyTable :: SemanticErrorKind -- | Extract semantic value from sequence of raw TOML expressions or report -- a semantic error. semantics :: [Expr] -> Either (Located SemanticError) Table instance GHC.Classes.Ord Toml.Semantics.SemanticErrorKind instance GHC.Classes.Eq Toml.Semantics.SemanticErrorKind instance GHC.Show.Show Toml.Semantics.SemanticErrorKind instance GHC.Read.Read Toml.Semantics.SemanticErrorKind instance GHC.Classes.Ord Toml.Semantics.SemanticError instance GHC.Classes.Eq Toml.Semantics.SemanticError instance GHC.Show.Show Toml.Semantics.SemanticError instance GHC.Read.Read Toml.Semantics.SemanticError instance GHC.Show.Show Toml.Semantics.FrameKind instance GHC.Show.Show Toml.Semantics.Frame -- | This module provides human-readable renderers for types used in this -- package to assist error message production. -- -- The generated Doc values are annotated with DocClass -- values to assist in producing syntax-highlighted outputs. -- -- To extract a plain String representation, use show. module Toml.Pretty -- | Pretty-printer document with TOML class attributes to aid in -- syntax-highlighting. type TomlDoc = Doc DocClass -- | Annotation used to enable styling pretty-printed TOML data DocClass -- | top-level [key] and [[key]] TableClass :: DocClass -- | dotted keys, left-hand side of assignments KeyClass :: DocClass -- | string literals StringClass :: DocClass -- | number literals NumberClass :: DocClass -- | date and time literals DateClass :: DocClass -- | boolean literals BoolClass :: DocClass -- | Render a complete TOML document using top-level table and array of -- table sections where possible. -- -- Keys are sorted alphabetically. To provide a custom ordering, see -- prettyTomlOrdered. prettyToml :: Table -> TomlDoc -- | Render a complete TOML document like prettyToml but use a -- custom key ordering. The comparison function has access to the -- complete key path. Note that only keys in the same table will every be -- compared. -- -- This operation allows you to render your TOML files with the most -- important sections first. A TOML file describing a package might -- desire to have the [package] section first before any of the -- ancilliary configuration sections. -- -- The table path is the name of the table being sorted. This -- allows the projection to be aware of which table is being sorted. -- -- The key is the key in the table being sorted. These are the -- keys that will be compared to each other. -- -- Here's a projection that puts the package section first, the -- secondary section second, and then all remaining cases are -- sorted alphabetically afterward. -- --
-- example :: [String] -> String -> Either Int String -- example [] "package" = Left 1 -- example [] "second" = Left 2 -- example _ other = Right other ---- -- We could also put the tables in reverse-alphabetical order by -- leveraging an existing newtype. -- --
-- reverseOrderProj :: [String] -> String -> Down String -- reverseOrderProj _ = Down --prettyTomlOrdered :: Ord a => ([String] -> String -> a) -> Table -> TomlDoc -- | Render a value suitable for assignment on the right-hand side of an -- equals sign. This value will always use inline table and list syntax. prettyValue :: Value -> TomlDoc -- | Render token for human-readable error messages. prettyToken :: Token -> String -- | Pretty-print a section heading. The result is annotated as a -- TableClass. prettySectionKind :: SectionKind -> NonEmpty String -> TomlDoc -- | Renders a simple-key using quotes where necessary. prettySimpleKey :: String -> Doc a -- | Renders a dotted-key using quotes where necessary and annotated as a -- KeyClass. prettyKey :: NonEmpty String -> TomlDoc -- | Render a semantic TOML error in a human-readable string. prettySemanticError :: SemanticError -> String -- | Render a TOML decoding error as a human-readable string. prettyMatchMessage :: MatchMessage -> String instance GHC.Classes.Ord Toml.Pretty.DocClass instance GHC.Classes.Eq Toml.Pretty.DocClass instance GHC.Show.Show Toml.Pretty.DocClass instance GHC.Read.Read Toml.Pretty.DocClass -- | This module parses TOML tokens into a list of raw, uninterpreted -- sections and assignments. module Toml.Parser -- | Headers and assignments corresponding to lines of a TOML file data Expr -- | key value assignment: key = value KeyValExpr :: Key -> Val -> Expr -- | table: [key] TableExpr :: Key -> Expr -- | array of tables: [[key]] ArrayTableExpr :: Key -> Expr -- | Kinds of table headers. data SectionKind -- |
-- reqKey key = reqKeyOf key fromValue --reqKey :: FromValue a => String -> ParseTable a -- | Convenience function for matching an optional key with a -- FromValue instance. -- --
-- optKey key = optKeyOf key fromValue --optKey :: FromValue a => String -> ParseTable (Maybe a) -- | Match a table entry by key or report an error if missing. -- -- See pickKey for more complex cases. reqKeyOf :: String -> (Value -> Matcher a) -> ParseTable a -- | Match a table entry by key if it exists or return Nothing if -- not. If the key is defined, it is matched by the given function. -- -- See pickKey for more complex cases. optKeyOf :: String -> (Value -> Matcher a) -> ParseTable (Maybe a) -- | Emit a warning at the current location. warnTable :: String -> ParseTable () -- | Key and value matching function data KeyAlt a -- | pick alternative based on key match Key :: String -> (Value -> Matcher a) -> KeyAlt a -- | default case when no previous cases matched Else :: Matcher a -> KeyAlt a -- | Take the first option from a list of table keys and matcher functions. -- This operation will commit to the first table key that matches. If the -- associated matcher fails, only that error will be propagated and the -- other alternatives will not be matched. -- -- If no keys match, an error message is generated explaining which keys -- would have been accepted. -- -- This is provided as an alternative to chaining multiple reqKey -- cases together with (<|>) because that will -- generate one error message for each unmatched alternative as well as -- the error associate with the matched alternative. pickKey :: [KeyAlt a] -> ParseTable a -- | Return the remaining portion of the table being matched. getTable :: ParseTable Table -- | Replace the remaining portion of the table being matched. setTable :: Table -> ParseTable () -- | Lift a matcher into the current table parsing context. liftMatcher :: Matcher a -> ParseTable a instance (GHC.Classes.Ord k, Toml.FromValue.FromKey k, Toml.FromValue.FromValue v) => Toml.FromValue.FromValue (Data.Map.Internal.Map k v) instance (a GHC.Types.~ GHC.Types.Char) => Toml.FromValue.FromKey [a] instance Toml.FromValue.FromKey Data.Text.Internal.Text instance Toml.FromValue.FromKey Data.Text.Internal.Lazy.Text instance Toml.FromValue.FromValue GHC.Num.Integer.Integer instance Toml.FromValue.FromValue GHC.Num.Natural.Natural instance Toml.FromValue.FromValue GHC.Types.Int instance Toml.FromValue.FromValue GHC.Int.Int8 instance Toml.FromValue.FromValue GHC.Int.Int16 instance Toml.FromValue.FromValue GHC.Int.Int32 instance Toml.FromValue.FromValue GHC.Int.Int64 instance Toml.FromValue.FromValue GHC.Types.Word instance Toml.FromValue.FromValue GHC.Word.Word8 instance Toml.FromValue.FromValue GHC.Word.Word16 instance Toml.FromValue.FromValue GHC.Word.Word32 instance Toml.FromValue.FromValue GHC.Word.Word64 instance Toml.FromValue.FromValue GHC.Types.Char instance Toml.FromValue.FromValue Data.Text.Internal.Text instance Toml.FromValue.FromValue Data.Text.Internal.Lazy.Text instance Toml.FromValue.FromValue GHC.Types.Double instance Toml.FromValue.FromValue GHC.Types.Float instance GHC.Real.Integral a => Toml.FromValue.FromValue (GHC.Real.Ratio a) instance Toml.FromValue.FromValue a => Toml.FromValue.FromValue (GHC.Base.NonEmpty a) instance Toml.FromValue.FromValue a => Toml.FromValue.FromValue (Data.Sequence.Internal.Seq a) instance Toml.FromValue.FromValue GHC.Types.Bool instance Toml.FromValue.FromValue a => Toml.FromValue.FromValue [a] instance Toml.FromValue.FromValue Data.Time.Calendar.Days.Day instance Toml.FromValue.FromValue Data.Time.LocalTime.Internal.TimeOfDay.TimeOfDay instance Toml.FromValue.FromValue Data.Time.LocalTime.Internal.ZonedTime.ZonedTime instance Toml.FromValue.FromValue Data.Time.LocalTime.Internal.LocalTime.LocalTime instance Toml.FromValue.FromValue Toml.Value.Value -- | Use genericParseTable to derive a ParseTable using the -- field names of a record. This can be combined with -- parseTableFromValue to derive a FromValue instance. module Toml.FromValue.Generic -- | Supports conversion of product types with field selector names to TOML -- values. class GParseTable f -- | Convert a value and apply the continuation to the result. gParseTable :: GParseTable f => (f a -> ParseTable b) -> ParseTable b -- | Match a Table using the field names in a record. genericParseTable :: (Generic a, GParseTable (Rep a)) => ParseTable a instance Toml.FromValue.Generic.GParseTable f => Toml.FromValue.Generic.GParseTable (GHC.Generics.D1 c f) instance Toml.FromValue.Generic.GParseTable f => Toml.FromValue.Generic.GParseTable (GHC.Generics.C1 c f) instance (Toml.FromValue.Generic.GParseTable f, Toml.FromValue.Generic.GParseTable g) => Toml.FromValue.Generic.GParseTable (f GHC.Generics.:*: g) instance (GHC.Generics.Selector s, Toml.FromValue.FromValue a) => Toml.FromValue.Generic.GParseTable (GHC.Generics.S1 s (GHC.Generics.K1 i (GHC.Maybe.Maybe a))) instance (GHC.Generics.Selector s, Toml.FromValue.FromValue a) => Toml.FromValue.Generic.GParseTable (GHC.Generics.S1 s (GHC.Generics.K1 i a)) instance Toml.FromValue.Generic.GParseTable GHC.Generics.U1 -- | This is the high-level interface to the toml-parser library. It -- enables parsing, printing, and coversion into and out of -- application-specific representations. -- -- This parser implements TOML 1.0.0 https://toml.io/en/v1.0.0 as -- carefully as possible. module Toml -- | Representation of a TOML key-value table. type Table = Map String Value -- | Semantic TOML value with all table assignments resolved. data Value Integer :: Integer -> Value Float :: Double -> Value Array :: [Value] -> Value Table :: Table -> Value Bool :: Bool -> Value String :: String -> Value TimeOfDay :: TimeOfDay -> Value ZonedTime :: ZonedTime -> Value LocalTime :: LocalTime -> Value Day :: Day -> Value -- | Parse a TOML formatted Value or report an error message. parse :: String -> Either String Table -- | Render a complete TOML document using top-level table and array of -- table sections where possible. -- -- Keys are sorted alphabetically. To provide a custom ordering, see -- prettyTomlOrdered. prettyToml :: Table -> TomlDoc -- | Annotation used to enable styling pretty-printed TOML data DocClass -- | top-level [key] and [[key]] TableClass :: DocClass -- | dotted keys, left-hand side of assignments KeyClass :: DocClass -- | string literals StringClass :: DocClass -- | number literals NumberClass :: DocClass -- | date and time literals DateClass :: DocClass -- | boolean literals BoolClass :: DocClass -- | Use the FromValue instance to decode a value from a TOML -- string. decode :: FromValue a => String -> Result String a -- | Use the ToTable instance to encode a value to a TOML string. encode :: ToTable a => a -> TomlDoc -- | Computation outcome with error and warning messages. Multiple error -- messages can occur when multiple alternatives all fail. Resolving any -- one of the error messages could allow the computation to succeed. data Result e a -- | error messages Failure :: [e] -> Result e a -- | warning messages and result Success :: [e] -> a -> Result e a