Safe Haskell | None |
---|---|
Language | GHC2021 |
Ide.Plugin.Cabal.Parse
Contents
Synopsis
- parseCabalFileContents :: ByteString -> IO ([PWarning], Either (Maybe Version, NonEmpty PError) GenericPackageDescription)
- type FilePath = String
- data NonEmpty a = a :| [a]
- data PWarning = PWarning !PWarnType !Position String
- data Version
- data PError = PError Position String
- data Position = Position !Int !Int
- data GenericPackageDescription = GenericPackageDescription {
- packageDescription :: PackageDescription
- gpdScannedVersion :: Maybe Version
- genPackageFlags :: [PackageFlag]
- condLibrary :: Maybe (CondTree ConfVar [Dependency] Library)
- condSubLibraries :: [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
- condForeignLibs :: [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
- condExecutables :: [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
- condTestSuites :: [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
- condBenchmarks :: [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
Documentation
Arguments
:: ByteString | UTF-8 encoded bytestring |
-> IO ([PWarning], Either (Maybe Version, NonEmpty PError) GenericPackageDescription) |
Re-exports
File and directory names are values of type String
, whose precise
meaning is operating system dependent. Files can be opened, yielding a
handle which can then be used to operate on the contents of that file.
Non-empty (and non-strict) list type.
Since: base-4.9.0.0
Constructors
a :| [a] infixr 5 |
Instances
MonadFix NonEmpty | Since: base-4.9.0.0 | ||||
Defined in Control.Monad.Fix | |||||
MonadZip NonEmpty | Since: base-4.9.0.0 | ||||
Foldable NonEmpty | Since: base-4.9.0.0 | ||||
Defined in Data.Foldable Methods fold :: Monoid m => NonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m # foldMap' :: Monoid m => (a -> m) -> NonEmpty a -> m # foldr :: (a -> b -> b) -> b -> NonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b # foldl :: (b -> a -> b) -> b -> NonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b # foldr1 :: (a -> a -> a) -> NonEmpty a -> a # foldl1 :: (a -> a -> a) -> NonEmpty a -> a # elem :: Eq a => a -> NonEmpty a -> Bool # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # | |||||
Foldable1 NonEmpty | Since: base-4.18.0.0 | ||||
Defined in Data.Foldable1 Methods fold1 :: Semigroup m => NonEmpty m -> m # foldMap1 :: Semigroup m => (a -> m) -> NonEmpty a -> m # foldMap1' :: Semigroup m => (a -> m) -> NonEmpty a -> m # toNonEmpty :: NonEmpty a -> NonEmpty a # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # foldrMap1 :: (a -> b) -> (a -> b -> b) -> NonEmpty a -> b # foldlMap1' :: (a -> b) -> (b -> a -> b) -> NonEmpty a -> b # foldlMap1 :: (a -> b) -> (b -> a -> b) -> NonEmpty a -> b # foldrMap1' :: (a -> b) -> (a -> b -> b) -> NonEmpty a -> b # | |||||
Eq1 NonEmpty | Since: base-4.10.0.0 | ||||
Ord1 NonEmpty | Since: base-4.10.0.0 | ||||
Defined in Data.Functor.Classes | |||||
Read1 NonEmpty | Since: base-4.10.0.0 | ||||
Defined in Data.Functor.Classes | |||||
Show1 NonEmpty | Since: base-4.10.0.0 | ||||
Traversable NonEmpty | Since: base-4.9.0.0 | ||||
Applicative NonEmpty | Since: base-4.9.0.0 | ||||
Functor NonEmpty | Since: base-4.9.0.0 | ||||
Monad NonEmpty | Since: base-4.9.0.0 | ||||
NFData1 NonEmpty | Since: deepseq-1.4.3.0 | ||||
Defined in Control.DeepSeq | |||||
Hashable1 NonEmpty | Since: hashable-1.3.1.0 | ||||
Defined in Data.Hashable.Class | |||||
Generic1 NonEmpty | |||||
Defined in GHC.Generics Associated Types
| |||||
Lift a => Lift (NonEmpty a :: Type) | Since: template-haskell-2.15.0.0 | ||||
Structured a => Structured (NonEmpty a) | |||||
Defined in Distribution.Utils.Structured | |||||
Data a => Data (NonEmpty a) | Since: base-4.9.0.0 | ||||
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmpty a -> c (NonEmpty a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmpty a) # toConstr :: NonEmpty a -> Constr # dataTypeOf :: NonEmpty a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmpty a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmpty a)) # gmapT :: (forall b. Data b => b -> b) -> NonEmpty a -> NonEmpty a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r # gmapQ :: (forall d. Data d => d -> u) -> NonEmpty a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmpty a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # | |||||
Semigroup (NonEmpty a) | Since: base-4.9.0.0 | ||||
Generic (NonEmpty a) | |||||
Defined in GHC.Generics Associated Types
| |||||
IsList (NonEmpty a) | Since: base-4.9.0.0 | ||||
Read a => Read (NonEmpty a) | Since: base-4.11.0.0 | ||||
Show a => Show (NonEmpty a) | Since: base-4.11.0.0 | ||||
NFData a => NFData (NonEmpty a) | Since: deepseq-1.4.2.0 | ||||
Defined in Control.DeepSeq | |||||
Outputable a => Outputable (NonEmpty a) | |||||
Defined in GHC.Utils.Outputable | |||||
Eq a => Eq (NonEmpty a) | Since: base-4.9.0.0 | ||||
Ord a => Ord (NonEmpty a) | Since: base-4.9.0.0 | ||||
Hashable a => Hashable (NonEmpty a) | |||||
Defined in Data.Hashable.Class | |||||
Ixed (NonEmpty a) | |||||
Defined in Control.Lens.At | |||||
Reversing (NonEmpty a) | |||||
Defined in Control.Lens.Internal.Iso | |||||
Wrapped (NonEmpty a) | |||||
Pretty a => Pretty (NonEmpty a) | |||||
Defined in Prettyprinter.Internal | |||||
t ~ NonEmpty b => Rewrapped (NonEmpty a) t | |||||
Defined in Control.Lens.Wrapped | |||||
Each (NonEmpty a) (NonEmpty b) a b |
| ||||
Newtype (NonEmpty a) (NonEmpty' sep wrapper a) | |||||
type Rep1 NonEmpty | Since: base-4.6.0.0 | ||||
Defined in GHC.Generics type Rep1 NonEmpty = D1 ('MetaData "NonEmpty" "GHC.Base" "base" 'False) (C1 ('MetaCons ":|" ('InfixI 'RightAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 []))) | |||||
type Rep (NonEmpty a) | Since: base-4.6.0.0 | ||||
Defined in GHC.Generics type Rep (NonEmpty a) = D1 ('MetaData "NonEmpty" "GHC.Base" "base" 'False) (C1 ('MetaCons ":|" ('InfixI 'RightAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a]))) | |||||
type Item (NonEmpty a) | |||||
Defined in GHC.IsList | |||||
type Index (NonEmpty a) | |||||
Defined in Control.Lens.At | |||||
type IxValue (NonEmpty a) | |||||
Defined in Control.Lens.At | |||||
type Unwrapped (NonEmpty a) | |||||
Defined in Control.Lens.Wrapped |
Parser warning.
Instances
A Version
represents the version of a software entity.
Instances of Eq
and Ord
are provided, which gives exact
equality and lexicographic ordering of the version number
components (i.e. 2.1 > 2.0, 1.2.3 > 1.2.2, etc.).
This type is opaque and distinct from the Version
type in
Data.Version since Cabal-2.0
. The difference extends to the
Binary
instance using a different (and more compact) encoding.
Since: Cabal-syntax-2.0.0.2
Instances
Parsec Version | |||||
Defined in Distribution.Types.Version Methods parsec :: CabalParsing m => m Version # | |||||
Pretty Version | |||||
Defined in Distribution.Types.Version | |||||
Structured Version | |||||
Defined in Distribution.Types.Version | |||||
Data Version | |||||
Defined in Distribution.Types.Version Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Version -> c Version # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Version # toConstr :: Version -> Constr # dataTypeOf :: Version -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Version) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Version) # gmapT :: (forall b. Data b => b -> b) -> Version -> Version # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQ :: (forall d. Data d => d -> u) -> Version -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Version -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version # | |||||
Generic Version | |||||
Defined in Distribution.Types.Version Associated Types
| |||||
Read Version | |||||
Show Version | |||||
Binary Version | |||||
NFData Version | |||||
Defined in Distribution.Types.Version | |||||
Eq Version | |||||
Ord Version | |||||
Defined in Distribution.Types.Version | |||||
type Rep Version | |||||
Defined in Distribution.Types.Version type Rep Version = D1 ('MetaData "Version" "Distribution.Types.Version" "Cabal-syntax-3.10.2.0-inplace" 'False) (C1 ('MetaCons "PV0" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedUnpack) (Rec0 Word64)) :+: C1 ('MetaCons "PV1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int]))) |
Parser error.
Instances
Generic PError | |||||
Defined in Distribution.Parsec.Error Associated Types
| |||||
Show PError | |||||
Binary PError | |||||
NFData PError | |||||
Defined in Distribution.Parsec.Error | |||||
type Rep PError | |||||
Defined in Distribution.Parsec.Error type Rep PError = D1 ('MetaData "PError" "Distribution.Parsec.Error" "Cabal-syntax-3.10.2.0-inplace" 'False) (C1 ('MetaCons "PError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) |
1-indexed row and column positions in a file.
Instances
Generic Position | |||||
Defined in Distribution.Parsec.Position Associated Types
| |||||
Show Position | |||||
Binary Position | |||||
NFData Position | |||||
Defined in Distribution.Parsec.Position | |||||
Eq Position | |||||
Ord Position | |||||
Defined in Distribution.Parsec.Position | |||||
type Rep Position | |||||
Defined in Distribution.Parsec.Position type Rep Position = D1 ('MetaData "Position" "Distribution.Parsec.Position" "Cabal-syntax-3.10.2.0-inplace" 'False) (C1 ('MetaCons "Position" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedUnpack) (Rec0 Int))) |
data GenericPackageDescription #
Constructors
GenericPackageDescription | |
Fields
|
Instances
Package GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription Methods packageId :: GenericPackageDescription -> PackageIdentifier # | |||||
HasBuildInfos GenericPackageDescription | |||||
Structured GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription Methods structure :: Proxy GenericPackageDescription -> Structure # structureHash' :: Tagged GenericPackageDescription MD5 | |||||
Data GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GenericPackageDescription -> c GenericPackageDescription # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GenericPackageDescription # toConstr :: GenericPackageDescription -> Constr # dataTypeOf :: GenericPackageDescription -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GenericPackageDescription) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GenericPackageDescription) # gmapT :: (forall b. Data b => b -> b) -> GenericPackageDescription -> GenericPackageDescription # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GenericPackageDescription -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GenericPackageDescription -> r # gmapQ :: (forall d. Data d => d -> u) -> GenericPackageDescription -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> GenericPackageDescription -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> GenericPackageDescription -> m GenericPackageDescription # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GenericPackageDescription -> m GenericPackageDescription # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GenericPackageDescription -> m GenericPackageDescription # | |||||
Generic GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription Associated Types
Methods from :: GenericPackageDescription -> Rep GenericPackageDescription x # to :: Rep GenericPackageDescription x -> GenericPackageDescription # | |||||
Show GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription Methods showsPrec :: Int -> GenericPackageDescription -> ShowS # show :: GenericPackageDescription -> String # showList :: [GenericPackageDescription] -> ShowS # | |||||
Binary GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription Methods put :: GenericPackageDescription -> Put # get :: Get GenericPackageDescription # putList :: [GenericPackageDescription] -> Put # | |||||
NFData GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription Methods rnf :: GenericPackageDescription -> () # | |||||
Eq GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription Methods (==) :: GenericPackageDescription -> GenericPackageDescription -> Bool # (/=) :: GenericPackageDescription -> GenericPackageDescription -> Bool # | |||||
type Rep GenericPackageDescription | |||||
Defined in Distribution.Types.GenericPackageDescription type Rep GenericPackageDescription = D1 ('MetaData "GenericPackageDescription" "Distribution.Types.GenericPackageDescription" "Cabal-syntax-3.10.2.0-inplace" 'False) (C1 ('MetaCons "GenericPackageDescription" 'PrefixI 'True) (((S1 ('MetaSel ('Just "packageDescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageDescription) :*: S1 ('MetaSel ('Just "gpdScannedVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Version))) :*: (S1 ('MetaSel ('Just "genPackageFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PackageFlag]) :*: S1 ('MetaSel ('Just "condLibrary") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (CondTree ConfVar [Dependency] Library))))) :*: ((S1 ('MetaSel ('Just "condSubLibraries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]) :*: S1 ('MetaSel ('Just "condForeignLibs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)])) :*: (S1 ('MetaSel ('Just "condExecutables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]) :*: (S1 ('MetaSel ('Just "condTestSuites") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]) :*: S1 ('MetaSel ('Just "condBenchmarks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)])))))) |