Copyright | © Jonathan Lorimer 2023 |
---|---|
License | MIT |
Maintainer | jonathanlorimer@pm.me |
Stability | stable |
Safe Haskell | None |
Language | Haskell2010 |
This module contains the generic machinery for value parsers. The main use
case for deriving ValueParser
generically is for sum types, as
instances for most common types are provided in Cfg.Parser.
Since: 0.0.2.0
Synopsis
- defaultValueParser :: (Generic a, GValueParser (Rep a)) => Parser a
- class GValueParser (f :: Type -> Type) where
Documentation
defaultValueParser :: (Generic a, GValueParser (Rep a)) => Parser a Source #
This is the function that hooks into the generic machinery. It is called by the deriving mechanism in Cfg.Deriving.Value.
Since: 0.0.2.0
class GValueParser (f :: Type -> Type) where Source #
This is a generic version of ValueParser
Since: 0.0.2.0
Instances
GValueParser (U1 :: Type -> Type) Source # | Since: 0.0.2.0 |
GValueParser (V1 :: Type -> Type) Source # | Since: 0.0.2.0 |
(GValueParser a, GValueParser b) => GValueParser (a :*: b) Source # | This is also an important instance for product types with unnamed fields that are intended to be parsed as values (not nested configurations). Since: 0.0.2.0 |
(GValueParser a, GValueParser b) => GValueParser (a :+: b) Source # | This is the main instance, which distributs a value parser over a sum type using retry and alternative. Since: 0.0.2.0 |
ValueParser a => GValueParser (K1 R a :: Type -> Type) Source # | Since: 0.0.2.0 |
Constructor c => GValueParser (M1 C c (U1 :: Type -> Type)) Source # | Since: 0.0.2.0 |
GValueParser f => GValueParser (M1 D s f) Source # | Since: 0.0.2.0 |
GValueParser f => GValueParser (M1 S s f) Source # | Since: 0.0.2.0 |