cabal-fmt-0.1.5: Format .cabal files

LicenseGPL-3.0-or-later
Safe HaskellNone
LanguageHaskell2010

CabalFmt.Fields

Description

Copyright: Oleg Grenrus

Synopsis

Documentation

data FieldDescrs s a Source #

A collection field parsers and pretty-printers.

Instances
FieldGrammar FieldDescrs Source # 
Instance details

Defined in CabalFmt.Fields

Functor (FieldDescrs s) Source # 
Instance details

Defined in CabalFmt.Fields

Methods

fmap :: (a -> b) -> FieldDescrs s a -> FieldDescrs s b #

(<$) :: a -> FieldDescrs s b -> FieldDescrs s a #

Applicative (FieldDescrs s) Source # 
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 #

Semigroup (FieldDescrs s a) Source # 
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 #

Monoid (FieldDescrs s a) Source # 
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 #

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

Lookup both pretty-printer and value parser.

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

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