configurator-ng-0.0.0.1: The next generation of configuration management

Copyright | (c) 2016 Leon P Smith
License | BSD3
Maintainer | Leon P Smith <leon@melding-monads.com>
Safe Haskell | None
Language | Haskell98

Data.Configurator.FromValue.Internal

Description

Synopsis

- type ConversionErrors = MultiErrors ConversionError
- newtype ValueParser a = ValueParser {
  - unValueParser :: Value -> (Maybe a, ConversionErrors)
  }
- newtype MaybeParser a = MaybeParser {
  - unMaybeParser :: Maybe Value -> (Maybe a, ConversionErrors)
  }
- data ListParserResult a
  - = NonListError
  - | ListError
  - | ListOk a [Value]
- newtype ListParser a = ListParser {
  - unListParser :: [Value] -> (ListParserResult a, ConversionErrors)
  }

# Documentation

type ConversionErrors = MultiErrors ConversionError #

newtype ValueParser a #

An action to turn a `Value` into zero or one values of type `a`, and possibly report errors/warnings.

Constructors

ValueParser |
Fields unValueParser :: Value -> (Maybe a, ConversionErrors)

Instances

Monad ValueParser # |
Methods (>>=) :: ValueParser a -> (a -> ValueParser b) -> ValueParser b # (>>) :: ValueParser a -> ValueParser b -> ValueParser b # return :: a -> ValueParser a # fail :: String -> ValueParser a #
Functor ValueParser # |
Methods fmap :: (a -> b) -> ValueParser a -> ValueParser b # (<$) :: a -> ValueParser b -> ValueParser a #
MonadFail ValueParser # |
Methods fail :: String -> ValueParser a #
Applicative ValueParser # |
Methods pure :: a -> ValueParser a # (<*>) :: ValueParser (a -> b) -> ValueParser a -> ValueParser b # (*>) :: ValueParser a -> ValueParser b -> ValueParser b # (<*) :: ValueParser a -> ValueParser b -> ValueParser a #
Alternative ValueParser # |
Methods empty :: ValueParser a # (<|>) :: ValueParser a -> ValueParser a -> ValueParser a # some :: ValueParser a -> ValueParser [a] # many :: ValueParser a -> ValueParser [a] #

newtype MaybeParser a #

An action to turn a `Maybe` `Value` into zero or one values of type `a`, and possibly report errors/warnings.

Constructors

MaybeParser |
Fields unMaybeParser :: Maybe Value -> (Maybe a, ConversionErrors)

Instances

Monad MaybeParser # |
Methods (>>=) :: MaybeParser a -> (a -> MaybeParser b) -> MaybeParser b # (>>) :: MaybeParser a -> MaybeParser b -> MaybeParser b # return :: a -> MaybeParser a # fail :: String -> MaybeParser a #
Functor MaybeParser # |
Methods fmap :: (a -> b) -> MaybeParser a -> MaybeParser b # (<$) :: a -> MaybeParser b -> MaybeParser a #
MonadFail MaybeParser # |
Methods fail :: String -> MaybeParser a #
Applicative MaybeParser # |
Methods pure :: a -> MaybeParser a # (<*>) :: MaybeParser (a -> b) -> MaybeParser a -> MaybeParser b # (*>) :: MaybeParser a -> MaybeParser b -> MaybeParser b # (<*) :: MaybeParser a -> MaybeParser b -> MaybeParser a #
Alternative MaybeParser # |
Methods empty :: MaybeParser a # (<|>) :: MaybeParser a -> MaybeParser a -> MaybeParser a # some :: MaybeParser a -> MaybeParser [a] # many :: MaybeParser a -> MaybeParser [a] #

data ListParserResult a #

Constructors

NonListError |
ListError |
ListOk a [Value] |

Instances

Functor ListParserResult # |
Methods fmap :: (a -> b) -> ListParserResult a -> ListParserResult b # (<$) :: a -> ListParserResult b -> ListParserResult a #

newtype ListParser a #

An action to turn a `[`Value`]` into zero or one values of type `a`, and possibly report errors/warnings.

Constructors

ListParser |
Fields unListParser :: [Value] -> (ListParserResult a, ConversionErrors)

Instances

Monad ListParser # |
Methods (>>=) :: ListParser a -> (a -> ListParser b) -> ListParser b # (>>) :: ListParser a -> ListParser b -> ListParser b # return :: a -> ListParser a # fail :: String -> ListParser a #
Functor ListParser # |
Methods fmap :: (a -> b) -> ListParser a -> ListParser b # (<$) :: a -> ListParser b -> ListParser a #
MonadFail ListParser # |
Methods fail :: String -> ListParser a #
Applicative ListParser # |
Methods pure :: a -> ListParser a # (<*>) :: ListParser (a -> b) -> ListParser a -> ListParser b # (*>) :: ListParser a -> ListParser b -> ListParser b # (<*) :: ListParser a -> ListParser b -> ListParser a #
Alternative ListParser # |
Methods empty :: ListParser a # (<|>) :: ListParser a -> ListParser a -> ListParser a # some :: ListParser a -> ListParser [a] # many :: ListParser a -> ListParser [a] #