Copyright | (c) 2018-2020 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- decode :: TomlCodec a -> Text -> Either [TomlDecodeError] a
- decodeValidation :: TomlCodec a -> Text -> Validation [TomlDecodeError] a
- decodeFileEither :: forall a m. MonadIO m => TomlCodec a -> FilePath -> m (Either [TomlDecodeError] a)
- decodeFile :: forall a m. MonadIO m => TomlCodec a -> FilePath -> m a
- encode :: TomlCodec a -> a -> Text
- encodeToFile :: forall a m. MonadIO m => TomlCodec a -> FilePath -> a -> m Text
- runTomlCodec :: TomlCodec a -> TOML -> Validation [TomlDecodeError] a
- execTomlCodec :: TomlCodec a -> a -> TOML
Decode
decode :: TomlCodec a -> Text -> Either [TomlDecodeError] a Source #
Convert textual representation of TOML
into user data type by the
provided codec.
Since: 0.0.0
decodeValidation :: TomlCodec a -> Text -> Validation [TomlDecodeError] a Source #
Convert textual representation of TOML
into user data type by the
provided codec.
Since: 1.3.0.0
decodeFileEither :: forall a m. MonadIO m => TomlCodec a -> FilePath -> m (Either [TomlDecodeError] a) Source #
Similar to decode
, but takes a path to a file with textual TOML
values from which it decodes them with the provided codec.
Since: 1.3.0.0
decodeFile :: forall a m. MonadIO m => TomlCodec a -> FilePath -> m a Source #
Similar to decodeFileEither
, throws LoadTomlException
in case of parse
errors (TomlDecodeError
).
Since: 0.3.1
Encode
encode :: TomlCodec a -> a -> Text Source #
Convert data type to the textual representation of TOML
values.
Since: 0.0.0
encodeToFile :: forall a m. MonadIO m => TomlCodec a -> FilePath -> a -> m Text Source #
Convert data type to the textual representation of TOML
values.
and write it info the given file.
Since: 1.3.0.0
Run
runTomlCodec :: TomlCodec a -> TOML -> Validation [TomlDecodeError] a Source #
Convert toml into user data type.
execTomlCodec :: TomlCodec a -> a -> TOML Source #
Runs codecWrite
of TomlCodec
and returns intermediate TOML AST.