cabal-fmt-0.1.12: Format .cabal files

Copyright | Oleg Grenrus
License | GPL-3.0-or-later
Safe Haskell | None
Language | Haskell2010

CabalFmt.Fields

Description

Synopsis

- data FieldDescrs s a
- fieldDescrLookup :: CabalParsing m => FieldDescrs s a -> FieldName -> r -> (forall f. m f -> (f -> Doc) -> r) -> Maybe r
- coerceFieldDescrs :: FieldDescrs s a -> FieldDescrs () ()
- singletonF :: FieldName -> (f -> Doc) -> (forall (m :: Type -> Type). CabalParsing m => m f) -> FieldDescrs s a

# Documentation

data FieldDescrs s a #

A collection field parsers and pretty-printers.

#### Instances

Instances details

Applicative (FieldDescrs s) # |
Instance details Defined in CabalFmt.Fields Methods pure :: a -> FieldDescrs s a # (<*>) :: FieldDescrs s (a -> b) -> FieldDescrs s a -> FieldDescrs s b # liftA2 :: (a -> b -> c) -> FieldDescrs s a -> FieldDescrs s b -> FieldDescrs s c # (*>) :: FieldDescrs s a -> FieldDescrs s b -> FieldDescrs s b # (<*) :: FieldDescrs s a -> FieldDescrs s b -> FieldDescrs s a #
Functor (FieldDescrs s) # |
Instance details Defined in CabalFmt.Fields Methods fmap :: (a -> b) -> FieldDescrs s a -> FieldDescrs s b # (<$) :: a -> FieldDescrs s b -> FieldDescrs s a #
Monoid (FieldDescrs s a) # |
Instance details Defined in CabalFmt.Fields Methods mempty :: FieldDescrs s a # mappend :: FieldDescrs s a -> FieldDescrs s a -> FieldDescrs s a # mconcat :: [FieldDescrs s a] -> FieldDescrs s a #
Semigroup (FieldDescrs s a) # |
Instance details Defined in CabalFmt.Fields Methods (<>) :: FieldDescrs s a -> FieldDescrs s a -> FieldDescrs s a # sconcat :: NonEmpty (FieldDescrs s a) -> FieldDescrs s a # stimes :: Integral b => b -> FieldDescrs s a -> FieldDescrs s a #

fieldDescrLookup :: CabalParsing m => FieldDescrs s a -> FieldName -> r -> (forall f. m f -> (f -> Doc) -> r) -> Maybe r #

Lookup both pretty-printer and value parser.

As the value of the field is unknown, we have to work with it universally.

coerceFieldDescrs :: FieldDescrs s a -> FieldDescrs () () #

singletonF :: FieldName -> (f -> Doc) -> (forall (m :: Type -> Type). CabalParsing m => m f) -> FieldDescrs s a #