trial-tomland-0.0.0.0: Trial helper functions for tomland
Copyright(c) 2020 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Trial.Tomland

Description

Trial helpers for tomland.

Synopsis

Documentation

trialCodec :: e -> TomlCodec a -> TomlCodec (Trial e a) Source #

TomlCodec for Trial that adds a given event e if a given codec fails.

Since: 0.0.0.0

trialStrCodec :: forall e a. (IsString e, Semigroup e) => (Key -> TomlCodec a) -> Key -> TomlCodec (Trial e a) Source #

TomlCodec for Trial that adds an informative message if a given codec fails.

Since: 0.0.0.0

trialMaybeCodec :: TomlCodec a -> TomlCodec (Trial e (Maybe a)) Source #

TomlCodec for Maybe inside Trial. Never fails, doesn't change history of events.

Since: 0.0.0.0

taggedTrialCodec :: forall tag a. tag -> (Key -> TomlCodec a) -> Key -> TomlCodec (TaggedTrial tag a) Source #

TomlCodec for TaggedTrial that uses given tag in a Fiasco if a given codec fails, and also adds tag to the result.

Since: 0.0.0.0

taggedTrialStrCodec :: forall tag a. (IsString tag, Semigroup tag) => (Key -> TomlCodec a) -> Key -> TomlCodec (TaggedTrial tag a) Source #

TomlCodec for TaggedTrial that adds an informative message if a given codec fails, and also adds a tag where the field comes from.

Since: 0.0.0.0

taggedTrialMaybeCodec :: IsString e => TomlCodec a -> TomlCodec (TaggedTrial e (Maybe a)) Source #

TomlCodec for Maybe inside TaggedTrial. Never fails, doesn't change history of events, and adds a tag.

Since: 0.0.0.0

taggedTrialListCodec :: forall e a. (IsString e, Semigroup e) => Key -> TomlCodec a -> TomlCodec (TaggedTrial e [a]) Source #

TomlCodec that decodes with list and adds fiasco to the result if the resulting list is empty. It's helpful to handle the case when the list is not specified at all.

Since: 0.0.0.0