{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module CabalGild.Type.SomeParsecParser where
import qualified CabalGild.Type.List as List
import qualified CabalGild.Type.Set as Set
import qualified Distribution.CabalSpecVersion as CabalSpecVersion
import qualified Distribution.Parsec as Parsec
import qualified Distribution.Pretty as Pretty
import qualified Text.PrettyPrint as PrettyPrint
data SomeParsecParser
= forall a.
SomeParsecParser
{ ()
parsec :: Parsec.ParsecParser a,
()
pretty :: CabalSpecVersion.CabalSpecVersion -> a -> PrettyPrint.Doc
}
list ::
forall s b a.
(Parsec.Parsec (List.List s b a), Pretty.Pretty (List.List s b a)) =>
SomeParsecParser
list :: forall s b a.
(Parsec (List s b a), Pretty (List s b a)) =>
SomeParsecParser
list =
SomeParsecParser
{ parsec :: ParsecParser (List s b a)
parsec = forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
Parsec.parsec @(List.List s b a),
pretty :: CabalSpecVersion -> List s b a -> Doc
pretty = CabalSpecVersion -> List s b a -> Doc
forall a. Pretty a => CabalSpecVersion -> a -> Doc
Pretty.prettyVersioned
}
set ::
forall s b a.
(Parsec.Parsec (Set.Set s b a), Pretty.Pretty (Set.Set s b a)) =>
SomeParsecParser
set :: forall s b a.
(Parsec (Set s b a), Pretty (Set s b a)) =>
SomeParsecParser
set =
SomeParsecParser
{ parsec :: ParsecParser (Set s b a)
parsec = forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
Parsec.parsec @(Set.Set s b a),
pretty :: CabalSpecVersion -> Set s b a -> Doc
pretty = CabalSpecVersion -> Set s b a -> Doc
forall a. Pretty a => CabalSpecVersion -> a -> Doc
Pretty.prettyVersioned
}