cabal-install
Safe HaskellNone
LanguageHaskell2010

Distribution.Client.Utils.Parsec

Synopsis

Documentation

Flag

alaFlag :: (a -> b) -> Flag a -> Flag' b a Source #

Flag' constructor, with additional phantom argument to constrain the resulting type

data Flag' b a Source #

Like List for usage with a FieldGrammar, but for Flag. This enables to parse type aliases such as FilePath that do not have Parsec instances by using newtype variants such as FilePathNT. For example, if you need to parse a 'Flag FilePath', you can use alaFlag FilePathNT'.

Instances

Instances details
Newtype (Flag a) (Flag' wrapper a) Source # 
Instance details

Defined in Distribution.Client.Utils.Parsec

Methods

pack :: Flag a -> Flag' wrapper a #

unpack :: Flag' wrapper a -> Flag a #

(Newtype a b, Parsec b) => Parsec (Flag' b a) Source # 
Instance details

Defined in Distribution.Client.Utils.Parsec

Methods

parsec :: CabalParsing m => m (Flag' b a) #

(Newtype a b, Pretty b) => Pretty (Flag' b a) Source # 
Instance details

Defined in Distribution.Client.Utils.Parsec

Methods

pretty :: Flag' b a -> Doc #

prettyVersioned :: CabalSpecVersion -> Flag' b a -> Doc #

NubList

alaNubList :: sep -> NubList a -> NubList' sep (Identity a) a Source #

alaNubList and alaNubList' are simply NubList' constructor, with additional phantom arguments to constrain the resulting type

>>> :t alaNubList VCat
alaNubList VCat :: NubList a -> NubList' VCat (Identity a) a
>>> :t alaNubList' FSep Token
alaNubList' FSep Token
  :: NubList String -> NubList' FSep Token String
>>> unpack' (alaNubList' FSep Token) <$> eitherParsec "foo bar foo"
Right ["foo","bar"]

alaNubList' :: sep -> (a -> b) -> NubList a -> NubList' sep b a Source #

More general version of alaNubList.

data NubList' sep b a Source #

Like List for usage with a FieldGrammar, but for NubList.

Instances

Instances details
Newtype (NubList a) (NubList' sep wrapper a) Source # 
Instance details

Defined in Distribution.Client.Utils.Parsec

Methods

pack :: NubList a -> NubList' sep wrapper a #

unpack :: NubList' sep wrapper a -> NubList a #

(Newtype a b, Ord a, Sep sep, Parsec b) => Parsec (NubList' sep b a) Source # 
Instance details

Defined in Distribution.Client.Utils.Parsec

Methods

parsec :: CabalParsing m => m (NubList' sep b a) #

(Newtype a b, Sep sep, Pretty b) => Pretty (NubList' sep b a) Source # 
Instance details

Defined in Distribution.Client.Utils.Parsec

Methods

pretty :: NubList' sep b a -> Doc #

prettyVersioned :: CabalSpecVersion -> NubList' sep b a -> Doc #

Newtype wrappers