Cabal-syntax 3.14.1.0 → 3.14.2.0
raw patch · 85 files changed
+198/−151 lines, 85 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Distribution.Types.VersionRange: hasGTLowerBound :: VersionRange -> Bool
+ Distribution.Types.VersionRange: hasLEUpperBound :: VersionRange -> Bool
+ Distribution.Types.VersionRange: hasTrailingZeroUpperBound :: VersionRange -> Bool
+ Distribution.Types.VersionRange: pattern GTLowerBound :: VersionRangeF a
+ Distribution.Types.VersionRange: pattern LEUpperBound :: VersionRangeF a
+ Distribution.Types.VersionRange: pattern TZUpperBound :: VersionRangeF a
+ Distribution.Types.VersionRange.Internal: pattern GTLowerBound :: VersionRangeF a
+ Distribution.Types.VersionRange.Internal: pattern LEUpperBound :: VersionRangeF a
+ Distribution.Types.VersionRange.Internal: pattern TZUpperBound :: VersionRangeF a
+ Distribution.Version: hasGTLowerBound :: VersionRange -> Bool
+ Distribution.Version: hasLEUpperBound :: VersionRange -> Bool
+ Distribution.Version: hasTrailingZeroUpperBound :: VersionRange -> Bool
+ Distribution.Version: pattern GTLowerBound :: VersionRangeF a
+ Distribution.Version: pattern LEUpperBound :: VersionRangeF a
+ Distribution.Version: pattern TZUpperBound :: VersionRangeF a
Files
- Cabal-syntax.cabal +1/−1
- ChangeLog.md +1/−1
- src/Distribution/Backpack.hs +2/−2
- src/Distribution/CabalSpecVersion.hs +1/−1
- src/Distribution/Compat/Binary.hs +0/−3
- src/Distribution/Compat/Exception.hs +0/−2
- src/Distribution/Compat/Graph.hs +0/−7
- src/Distribution/Compat/MonadFail.hs +0/−2
- src/Distribution/Compat/Newtype.hs +0/−1
- src/Distribution/Compat/NonEmptySet.hs +1/−2
- src/Distribution/Compat/Prelude.hs +0/−1
- src/Distribution/Compat/Semigroup.hs +2/−5
- src/Distribution/Compiler.hs +3/−4
- src/Distribution/FieldGrammar/Class.hs +0/−1
- src/Distribution/Fields/ParseResult.hs +0/−1
- src/Distribution/License.hs +1/−1
- src/Distribution/ModuleName.hs +1/−1
- src/Distribution/PackageDescription/Parsec.hs +0/−3
- src/Distribution/Parsec.hs +0/−1
- src/Distribution/SPDX/License.hs +1/−1
- src/Distribution/SPDX/LicenseExceptionId.hs +1/−1
- src/Distribution/SPDX/LicenseExpression.hs +2/−2
- src/Distribution/SPDX/LicenseId.hs +1/−1
- src/Distribution/SPDX/LicenseReference.hs +1/−1
- src/Distribution/System.hs +3/−6
- src/Distribution/Types/AbiDependency.hs +1/−2
- src/Distribution/Types/AbiHash.hs +1/−2
- src/Distribution/Types/Benchmark.hs +1/−1
- src/Distribution/Types/BenchmarkInterface.hs +1/−1
- src/Distribution/Types/BenchmarkType.hs +1/−1
- src/Distribution/Types/BuildInfo.hs +1/−1
- src/Distribution/Types/BuildType.hs +1/−1
- src/Distribution/Types/ComponentId.hs +1/−1
- src/Distribution/Types/ComponentName.hs +2/−3
- src/Distribution/Types/ComponentRequestedSpec.hs +1/−2
- src/Distribution/Types/CondTree.hs +2/−2
- src/Distribution/Types/Condition.hs +1/−1
- src/Distribution/Types/ConfVar.hs +1/−1
- src/Distribution/Types/Dependency.hs +1/−1
- src/Distribution/Types/ExeDependency.hs +1/−1
- src/Distribution/Types/Executable.hs +1/−1
- src/Distribution/Types/ExecutableScope.hs +1/−1
- src/Distribution/Types/ExposedModule.hs +1/−2
- src/Distribution/Types/Flag.hs +3/−3
- src/Distribution/Types/ForeignLib.hs +2/−2
- src/Distribution/Types/ForeignLibOption.hs +1/−1
- src/Distribution/Types/ForeignLibType.hs +1/−1
- src/Distribution/Types/GenericPackageDescription.hs +1/−1
- src/Distribution/Types/IncludeRenaming.hs +1/−1
- src/Distribution/Types/InstalledPackageInfo.hs +1/−2
- src/Distribution/Types/LegacyExeDependency.hs +1/−1
- src/Distribution/Types/Library.hs +1/−1
- src/Distribution/Types/LibraryName.hs +1/−1
- src/Distribution/Types/LibraryVisibility.hs +1/−1
- src/Distribution/Types/Mixin.hs +1/−1
- src/Distribution/Types/Module.hs +1/−1
- src/Distribution/Types/ModuleReexport.hs +1/−1
- src/Distribution/Types/ModuleRenaming.hs +1/−1
- src/Distribution/Types/MungedPackageId.hs +1/−1
- src/Distribution/Types/MungedPackageName.hs +1/−1
- src/Distribution/Types/PackageDescription.hs +1/−1
- src/Distribution/Types/PackageId.hs +1/−1
- src/Distribution/Types/PackageName.hs +1/−1
- src/Distribution/Types/PackageVersionConstraint.hs +1/−1
- src/Distribution/Types/PkgconfigDependency.hs +1/−1
- src/Distribution/Types/PkgconfigName.hs +1/−1
- src/Distribution/Types/PkgconfigVersion.hs +1/−1
- src/Distribution/Types/PkgconfigVersionRange.hs +1/−1
- src/Distribution/Types/SetupBuildInfo.hs +1/−1
- src/Distribution/Types/SourceRepo.hs +4/−4
- src/Distribution/Types/TestSuite.hs +1/−1
- src/Distribution/Types/TestSuiteInterface.hs +1/−1
- src/Distribution/Types/TestType.hs +1/−1
- src/Distribution/Types/UnitId.hs +2/−2
- src/Distribution/Types/UnqualComponentName.hs +0/−1
- src/Distribution/Types/Version.hs +1/−1
- src/Distribution/Types/VersionInterval.hs +1/−2
- src/Distribution/Types/VersionInterval/Legacy.hs +1/−3
- src/Distribution/Types/VersionRange.hs +86/−15
- src/Distribution/Types/VersionRange/Internal.hs +20/−3
- src/Distribution/Utils/Generic.hs +0/−4
- src/Distribution/Utils/Path.hs +1/−1
- src/Distribution/Utils/ShortText.hs +2/−2
- src/Distribution/Version.hs +3/−0
- src/Language/Haskell/Extension.hs +3/−3
Cabal-syntax.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-syntax-version: 3.14.1.0+version: 3.14.2.0 copyright: 2003-2024, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE
ChangeLog.md view
@@ -1,1 +1,1 @@-Please see https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.14.1.0.md+Please see https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.14.2.0.md
src/Distribution/Backpack.hs view
@@ -91,7 +91,7 @@ -- MUST NOT be for an indefinite component; an 'OpenUnitId' -- is guaranteed not to have any holes. DefiniteUnitId DefUnitId- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) -- TODO: cache holes? @@ -165,7 +165,7 @@ data OpenModule = OpenModule OpenUnitId ModuleName | OpenModuleVar ModuleName- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary OpenModule instance Structured OpenModule
src/Distribution/CabalSpecVersion.hs view
@@ -35,7 +35,7 @@ | -- 3.10: no changes CabalSpecV3_12 | CabalSpecV3_14- deriving (Eq, Ord, Show, Read, Enum, Bounded, Typeable, Data, Generic)+ deriving (Eq, Ord, Show, Read, Enum, Bounded, Data, Generic) instance Binary CabalSpecVersion instance Structured CabalSpecVersion
src/Distribution/Compat/Binary.hs view
@@ -1,6 +1,3 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE PatternSynonyms #-}- module Distribution.Compat.Binary ( decodeOrFailIO , decodeFileOrFail'
src/Distribution/Compat/Exception.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE CPP #-}- module Distribution.Compat.Exception ( catchIO , catchExit
src/Distribution/Compat/Graph.hs view
@@ -1,16 +1,10 @@ {-# LANGUAGE BangPatterns #-}-{-# LANGUAGE CPP #-}-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -------------------------------------------------------------------------------------------------------------------------------------------------------------- -- | -- Module : Distribution.Compat.Graph -- Copyright : (c) Edward Z. Yang 2016@@ -122,7 +116,6 @@ , graphKeyToVertex :: Key a -> Maybe G.Vertex , graphBroken :: [(a, [Key a])] }- deriving (Typeable) -- NB: Not a Functor! (or Traversable), because you need -- to restrict Key a ~ Key b. We provide our own mapping
src/Distribution/Compat/MonadFail.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE CPP #-}- -- | Compatibility layer for "Control.Monad.Fail" module Distribution.Compat.MonadFail (Control.Monad.Fail.MonadFail (fail)) where
src/Distribution/Compat/Newtype.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-}
src/Distribution/Compat/NonEmptySet.hs view
@@ -32,7 +32,6 @@ import Data.Data (Data) import Data.List.NonEmpty (NonEmpty (..)) import Data.Semigroup (Semigroup (..))-import Data.Typeable (Typeable) import qualified Data.Foldable as F import qualified Data.Set as Set@@ -48,7 +47,7 @@ -- | @since 3.4.0.0 newtype NonEmptySet a = NES (Set.Set a)- deriving (Eq, Ord, Typeable, Data, Read)+ deriving (Eq, Ord, Data, Read) ------------------------------------------------------------------------------- -- Instances
src/Distribution/Compat/Prelude.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE Trustworthy #-}
src/Distribution/Compat/Semigroup.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}@@ -18,7 +16,6 @@ , gmempty ) where -import Data.Typeable (Typeable) import Distribution.Compat.Binary (Binary) import Distribution.Utils.Structured (Structured) @@ -39,7 +36,7 @@ -- | A copy of 'Data.Semigroup.Last'. newtype Last' a = Last' {getLast' :: a}- deriving (Eq, Ord, Read, Show, Generic, Binary, Typeable)+ deriving (Eq, Ord, Read, Show, Generic, Binary) instance Structured a => Structured (Last' a) @@ -52,7 +49,7 @@ -- | A wrapper around 'Maybe', providing the 'Semigroup' and 'Monoid' instances -- implemented for 'Maybe' since @base-4.11@. newtype Option' a = Option' {getOption' :: Maybe a}- deriving (Eq, Ord, Read, Show, Binary, Generic, Functor, Typeable)+ deriving (Eq, Ord, Read, Show, Binary, Generic, Functor) instance Structured a => Structured (Option' a)
src/Distribution/Compiler.hs view
@@ -78,7 +78,7 @@ | MHS -- MicroHS, see https://github.com/augustss/MicroHs | HaskellSuite String -- string is the id of the actual compiler | OtherCompiler String- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary CompilerFlavor instance Structured CompilerFlavor@@ -143,7 +143,6 @@ , Read , Eq , Ord- , Typeable , Data , Functor , Foldable@@ -174,7 +173,7 @@ -- ------------------------------------------------------------ data CompilerId = CompilerId CompilerFlavor Version- deriving (Eq, Generic, Ord, Read, Show, Typeable)+ deriving (Eq, Generic, Ord, Read, Show) instance Binary CompilerId instance Structured CompilerId@@ -224,7 +223,7 @@ data AbiTag = NoAbiTag | AbiTag String- deriving (Eq, Generic, Show, Read, Typeable)+ deriving (Eq, Generic, Show, Read) instance Binary AbiTag instance Structured AbiTag
src/Distribution/FieldGrammar/Class.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE RankNTypes #-}
src/Distribution/Fields/ParseResult.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE BangPatterns #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-}
src/Distribution/License.hs view
@@ -111,7 +111,7 @@ OtherLicense | -- | Indicates an erroneous license name. UnknownLicense String- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary License instance Structured License
src/Distribution/ModuleName.hs view
@@ -40,7 +40,7 @@ -- | A valid Haskell module name. newtype ModuleName = ModuleName ShortText- deriving (Eq, Generic, Ord, Read, Show, Typeable, Data)+ deriving (Eq, Generic, Ord, Read, Show, Data) unModuleName :: ModuleName -> String unModuleName (ModuleName s) = fromShortText s
src/Distribution/PackageDescription/Parsec.hs view
@@ -1,10 +1,7 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE ScopedTypeVariables #-}------------------------------------------------------------------------------- -- | -- Module : Distribution.PackageDescription.Parsec
src/Distribution/Parsec.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE BangPatterns #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-}
src/Distribution/SPDX/License.hs view
@@ -41,7 +41,7 @@ NONE | -- | A valid SPDX License Expression as defined in Appendix IV. License LicenseExpression- deriving (Show, Read, Eq, Ord, Typeable, Data, Generic)+ deriving (Show, Read, Eq, Ord, Data, Generic) instance Binary License instance Structured License
src/Distribution/SPDX/LicenseExceptionId.hs view
@@ -104,7 +104,7 @@ | Vsftpd_openssl_exception -- ^ @vsftpd-openssl-exception@, vsftpd OpenSSL exception, SPDX License List 3.23, SPDX License List 3.25 | WxWindows_exception_3_1 -- ^ @WxWindows-exception-3.1@, WxWindows Library Exception 3.1 | X11vnc_openssl_exception -- ^ @x11vnc-openssl-exception@, x11vnc OpenSSL Exception, SPDX License List 3.23, SPDX License List 3.25- deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data, Generic)+ deriving (Eq, Ord, Enum, Bounded, Show, Read, Data, Generic) instance Binary LicenseExceptionId where put = Binary.putWord8 . fromIntegral . fromEnum
src/Distribution/SPDX/LicenseExpression.hs view
@@ -43,7 +43,7 @@ = ELicense !SimpleLicenseExpression !(Maybe LicenseExceptionId) | EAnd !LicenseExpression !LicenseExpression | EOr !LicenseExpression !LicenseExpression- deriving (Show, Read, Eq, Ord, Typeable, Data, Generic)+ deriving (Show, Read, Eq, Ord, Data, Generic) -- | Simple License Expressions. data SimpleLicenseExpression@@ -53,7 +53,7 @@ ELicenseIdPlus LicenseId | -- | A SPDX user defined license reference: For example: @LicenseRef-23@, @LicenseRef-MIT-Style-1@, or @DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2@ ELicenseRef LicenseRef- deriving (Show, Read, Eq, Ord, Typeable, Data, Generic)+ deriving (Show, Read, Eq, Ord, Data, Generic) simpleLicenseExpression :: LicenseId -> LicenseExpression simpleLicenseExpression i = ELicense (ELicenseId i) Nothing
src/Distribution/SPDX/LicenseId.hs view
@@ -674,7 +674,7 @@ | ZPL_1_1 -- ^ @ZPL-1.1@, Zope Public License 1.1 | ZPL_2_0 -- ^ @ZPL-2.0@, Zope Public License 2.0 | ZPL_2_1 -- ^ @ZPL-2.1@, Zope Public License 2.1- deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data)+ deriving (Eq, Ord, Enum, Bounded, Show, Read, Data) instance Binary LicenseId where -- Word16 is encoded in big endianess
src/Distribution/SPDX/LicenseReference.hs view
@@ -24,7 +24,7 @@ { _lrDocument :: !(Maybe String) , _lrLicense :: !String }- deriving (Show, Read, Eq, Ord, Typeable, Data, Generic)+ deriving (Show, Read, Eq, Ord, Data, Generic) -- | License reference. licenseRef :: LicenseRef -> String
src/Distribution/System.hs view
@@ -1,10 +1,7 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} ------------------------------------------------------------------------------- -- | -- Module : Distribution.System -- Copyright : Duncan Coutts 2007-2008@@ -110,7 +107,7 @@ | Wasi | Haiku | OtherOS String- deriving (Eq, Generic, Ord, Show, Read, Typeable, Data)+ deriving (Eq, Generic, Ord, Show, Read, Data) instance Binary OS instance Structured OS@@ -213,7 +210,7 @@ | JavaScript | Wasm32 | OtherArch String- deriving (Eq, Generic, Ord, Show, Read, Typeable, Data)+ deriving (Eq, Generic, Ord, Show, Read, Data) instance Binary Arch instance Structured Arch@@ -284,7 +281,7 @@ -- ------------------------------------------------------------ data Platform = Platform Arch OS- deriving (Eq, Generic, Ord, Show, Read, Typeable, Data)+ deriving (Eq, Generic, Ord, Show, Read, Data) instance Binary Platform instance Structured Platform
src/Distribution/Types/AbiDependency.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Distribution.Types.AbiDependency where@@ -27,7 +26,7 @@ { depUnitId :: Package.UnitId , depAbiHash :: Package.AbiHash }- deriving (Eq, Generic, Read, Show, Typeable)+ deriving (Eq, Generic, Read, Show) instance Pretty AbiDependency where pretty (AbiDependency uid abi) =
src/Distribution/Types/AbiHash.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} @@ -27,7 +26,7 @@ -- -- @since 2.0.0.2 newtype AbiHash = AbiHash ShortText- deriving (Eq, Show, Read, Generic, Typeable)+ deriving (Eq, Show, Read, Generic) -- | Convert 'AbiHash' to 'String' --
src/Distribution/Types/Benchmark.hs view
@@ -27,7 +27,7 @@ , benchmarkInterface :: BenchmarkInterface , benchmarkBuildInfo :: BuildInfo }- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary Benchmark instance Structured Benchmark
src/Distribution/Types/BenchmarkInterface.hs view
@@ -27,7 +27,7 @@ | -- | A benchmark that does not conform to one of the above -- interfaces for the given reason (e.g. unknown benchmark type). BenchmarkUnsupported BenchmarkType- deriving (Eq, Ord, Generic, Read, Show, Typeable, Data)+ deriving (Eq, Ord, Generic, Read, Show, Data) instance Binary BenchmarkInterface instance Structured BenchmarkInterface
src/Distribution/Types/BenchmarkType.hs view
@@ -22,7 +22,7 @@ BenchmarkTypeExe Version | -- | Some unknown benchmark type e.g. \"type: foo\" BenchmarkTypeUnknown String Version- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary BenchmarkType instance Structured BenchmarkType
src/Distribution/Types/BuildInfo.hs view
@@ -144,7 +144,7 @@ -- ^ Dependencies specific to a library or executable target , mixins :: [Mixin] }- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary BuildInfo instance Structured BuildInfo
src/Distribution/Types/BuildType.hs view
@@ -30,7 +30,7 @@ | -- | uses user-supplied @Setup.hs@ or @Setup.lhs@ (default) Custom | Hooks- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary BuildType instance Structured BuildType
src/Distribution/Types/ComponentId.hs view
@@ -32,7 +32,7 @@ -- -- @since 2.0.0.2 newtype ComponentId = ComponentId ShortText- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) -- | Construct a 'ComponentId' from a 'String' --
src/Distribution/Types/ComponentName.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE PatternSynonyms #-} @@ -25,14 +24,14 @@ data ComponentName = CLibName LibraryName | CNotLibName NotLibComponentName- deriving (Eq, Generic, Ord, Read, Show, Typeable)+ deriving (Eq, Generic, Ord, Read, Show) data NotLibComponentName = CNLFLibName {toCompName :: UnqualComponentName} | CNLExeName {toCompName :: UnqualComponentName} | CNLTestName {toCompName :: UnqualComponentName} | CNLBenchName {toCompName :: UnqualComponentName}- deriving (Eq, Generic, Ord, Read, Show, Typeable)+ deriving (Eq, Generic, Ord, Read, Show) pattern CFLibName :: UnqualComponentName -> ComponentName pattern CFLibName n = CNotLibName (CNLFLibName n)
src/Distribution/Types/ComponentRequestedSpec.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Distribution.Types.ComponentRequestedSpec@@ -67,7 +66,7 @@ , benchmarksRequested :: Bool } | OneComponentRequestedSpec ComponentName- deriving (Generic, Read, Show, Eq, Typeable)+ deriving (Generic, Read, Show, Eq) instance Binary ComponentRequestedSpec instance Structured ComponentRequestedSpec
src/Distribution/Types/CondTree.hs view
@@ -61,7 +61,7 @@ , condTreeConstraints :: c , condTreeComponents :: [CondBranch v c a] }- deriving (Show, Eq, Typeable, Data, Generic, Functor, Foldable, Traversable)+ deriving (Show, Eq, Data, Generic, Functor, Foldable, Traversable) instance (Binary v, Binary c, Binary a) => Binary (CondTree v c a) instance (Structured v, Structured c, Structured a) => Structured (CondTree v c a)@@ -82,7 +82,7 @@ , condBranchIfTrue :: CondTree v c a , condBranchIfFalse :: Maybe (CondTree v c a) }- deriving (Show, Eq, Typeable, Data, Generic, Functor, Traversable)+ deriving (Show, Eq, Data, Generic, Functor, Traversable) -- This instance is written by hand because GHC 8.0.1/8.0.2 infinite -- loops when trying to derive it with optimizations. See
src/Distribution/Types/Condition.hs view
@@ -19,7 +19,7 @@ | CNot (Condition c) | COr (Condition c) (Condition c) | CAnd (Condition c) (Condition c)- deriving (Show, Eq, Typeable, Data, Generic)+ deriving (Show, Eq, Data, Generic) -- | Boolean negation of a 'Condition' value. cNot :: Condition a -> Condition a
src/Distribution/Types/ConfVar.hs view
@@ -19,7 +19,7 @@ | Arch Arch | PackageFlag FlagName | Impl CompilerFlavor VersionRange- deriving (Eq, Show, Typeable, Data, Generic)+ deriving (Eq, Show, Data, Generic) instance Binary ConfVar instance Structured ConfVar
src/Distribution/Types/Dependency.hs view
@@ -41,7 +41,7 @@ PackageName VersionRange (NonEmptySet LibraryName)- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) depPkgName :: Dependency -> PackageName depPkgName (Dependency pn _ _) = pn
src/Distribution/Types/ExeDependency.hs view
@@ -25,7 +25,7 @@ PackageName UnqualComponentName -- name of executable component of package VersionRange- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary ExeDependency instance Structured ExeDependency
src/Distribution/Types/Executable.hs view
@@ -26,7 +26,7 @@ , exeScope :: ExecutableScope , buildInfo :: BuildInfo }- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance L.HasBuildInfo Executable where buildInfo f l = (\x -> l{buildInfo = x}) <$> f (buildInfo l)
src/Distribution/Types/ExecutableScope.hs view
@@ -18,7 +18,7 @@ data ExecutableScope = ExecutablePublic | ExecutablePrivate- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Pretty ExecutableScope where pretty ExecutablePublic = Disp.text "public"
src/Distribution/Types/ExposedModule.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Distribution.Types.ExposedModule where@@ -18,7 +17,7 @@ { exposedName :: ModuleName , exposedReexport :: Maybe OpenModule }- deriving (Eq, Generic, Read, Show, Typeable)+ deriving (Eq, Generic, Read, Show) instance Pretty ExposedModule where pretty (ExposedModule m reexport) =
src/Distribution/Types/Flag.hs view
@@ -56,7 +56,7 @@ , flagDefault :: Bool , flagManual :: Bool }- deriving (Show, Eq, Typeable, Data, Generic)+ deriving (Show, Eq, Data, Generic) instance Binary PackageFlag instance Structured PackageFlag@@ -80,7 +80,7 @@ -- -- @since 2.0.0.2 newtype FlagName = FlagName ShortText- deriving (Eq, Generic, Ord, Show, Read, Typeable, Data, NFData)+ deriving (Eq, Generic, Ord, Show, Read, Data, NFData) -- | Construct a 'FlagName' from a 'String' --@@ -127,7 +127,7 @@ -- -- TODO: Why we record the multiplicity of the flag? newtype FlagAssignment = FlagAssignment {getFlagAssignment :: Map.Map FlagName (Int, Bool)}- deriving (Binary, Generic, NFData, Typeable)+ deriving (Binary, Generic, NFData) instance Structured FlagAssignment
src/Distribution/Types/ForeignLib.hs view
@@ -61,9 +61,9 @@ -- This is a list rather than a maybe field so that we can flatten -- the condition trees (for instance, when creating an sdist) }- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) -data LibVersionInfo = LibVersionInfo Int Int Int deriving (Data, Eq, Generic, Typeable)+data LibVersionInfo = LibVersionInfo Int Int Int deriving (Data, Eq, Generic) instance Ord LibVersionInfo where LibVersionInfo c r _ `compare` LibVersionInfo c' r' _ =
src/Distribution/Types/ForeignLibOption.hs view
@@ -22,7 +22,7 @@ -- This option is compulsory on Windows and unsupported -- on other platforms. ForeignLibStandalone- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Pretty ForeignLibOption where pretty ForeignLibStandalone = Disp.text "standalone"
src/Distribution/Types/ForeignLibType.hs view
@@ -27,7 +27,7 @@ ForeignLibNativeStatic | -- TODO: Maybe this should record a string? ForeignLibTypeUnknown- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Pretty ForeignLibType where pretty ForeignLibNativeShared = Disp.text "native-shared"
src/Distribution/Types/GenericPackageDescription.hs view
@@ -71,7 +71,7 @@ ) ] }- deriving (Show, Eq, Typeable, Data, Generic)+ deriving (Show, Eq, Data, Generic) instance Package GenericPackageDescription where packageId = packageId . packageDescription
src/Distribution/Types/IncludeRenaming.hs view
@@ -26,7 +26,7 @@ { includeProvidesRn :: ModuleRenaming , includeRequiresRn :: ModuleRenaming }- deriving (Show, Read, Eq, Ord, Typeable, Data, Generic)+ deriving (Show, Read, Eq, Ord, Data, Generic) instance Binary IncludeRenaming instance Structured IncludeRenaming
src/Distribution/Types/InstalledPackageInfo.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-}@@ -95,7 +94,7 @@ , haddockHTMLs :: [FilePath] , pkgRoot :: Maybe FilePath }- deriving (Eq, Generic, Typeable, Read, Show)+ deriving (Eq, Generic, Read, Show) instance Binary InstalledPackageInfo instance Structured InstalledPackageInfo
src/Distribution/Types/LegacyExeDependency.hs view
@@ -26,7 +26,7 @@ = LegacyExeDependency String VersionRange- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary LegacyExeDependency instance Structured LegacyExeDependency
src/Distribution/Types/Library.hs view
@@ -31,7 +31,7 @@ -- ^ Whether this multilib can be used as a dependency for other packages. , libBuildInfo :: BuildInfo }- deriving (Generic, Show, Eq, Ord, Read, Typeable, Data)+ deriving (Generic, Show, Eq, Ord, Read, Data) instance L.HasBuildInfo Library where buildInfo f l = (\x -> l{libBuildInfo = x}) <$> f (libBuildInfo l)
src/Distribution/Types/LibraryName.hs view
@@ -27,7 +27,7 @@ data LibraryName = LMainLibName | LSubLibName UnqualComponentName- deriving (Eq, Generic, Ord, Read, Show, Typeable, Data)+ deriving (Eq, Generic, Ord, Read, Show, Data) instance Binary LibraryName instance Structured LibraryName
src/Distribution/Types/LibraryVisibility.hs view
@@ -23,7 +23,7 @@ LibraryVisibilityPublic | -- | Internal library, default LibraryVisibilityPrivate- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Pretty LibraryVisibility where pretty LibraryVisibilityPublic = Disp.text "public"
src/Distribution/Types/Mixin.hs view
@@ -31,7 +31,7 @@ , mixinLibraryName :: LibraryName , mixinIncludeRenaming :: IncludeRenaming }- deriving (Show, Read, Eq, Ord, Typeable, Data, Generic)+ deriving (Show, Read, Eq, Ord, Data, Generic) instance Binary Mixin instance Structured Mixin
src/Distribution/Types/Module.hs view
@@ -26,7 +26,7 @@ -- the 'InstalledPackageInfo'. data Module = Module DefUnitId ModuleName- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary Module instance Structured Module
src/Distribution/Types/ModuleReexport.hs view
@@ -24,7 +24,7 @@ , moduleReexportOriginalName :: ModuleName , moduleReexportName :: ModuleName }- deriving (Eq, Ord, Generic, Read, Show, Typeable, Data)+ deriving (Eq, Ord, Generic, Read, Show, Data) instance Binary ModuleReexport instance Structured ModuleReexport
src/Distribution/Types/ModuleRenaming.hs view
@@ -40,7 +40,7 @@ | -- | Hiding renaming, e.g., @hiding (A, B)@, bringing all -- exported modules into scope except the hidden ones. HidingRenaming [ModuleName]- deriving (Show, Read, Eq, Ord, Typeable, Data, Generic)+ deriving (Show, Read, Eq, Ord, Data, Generic) -- | Interpret a 'ModuleRenaming' as a partial map from 'ModuleName' -- to 'ModuleName'. For efficiency, you should partially apply it
src/Distribution/Types/MungedPackageId.hs view
@@ -28,7 +28,7 @@ , mungedVersion :: Version -- ^ The version of this package / component, eg 1.2 }- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary MungedPackageId instance Structured MungedPackageId
src/Distribution/Types/MungedPackageName.hs view
@@ -31,7 +31,7 @@ -- -- @since 2.0.0.2 data MungedPackageName = MungedPackageName !PackageName !LibraryName- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary MungedPackageName instance Structured MungedPackageName
src/Distribution/Types/PackageDescription.hs view
@@ -151,7 +151,7 @@ , extraDocFiles :: [RelativePath Pkg File] , extraFiles :: [RelativePath Pkg File] }- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary PackageDescription instance Structured PackageDescription
src/Distribution/Types/PackageId.hs view
@@ -28,7 +28,7 @@ , pkgVersion :: Version -- ^ the version of this package, eg 1.2 }- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary PackageIdentifier instance Structured PackageIdentifier
src/Distribution/Types/PackageName.hs view
@@ -27,7 +27,7 @@ -- -- @since 2.0.0.2 newtype PackageName = PackageName ShortText- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) -- | Convert 'PackageName' to 'String' unPackageName :: PackageName -> String
src/Distribution/Types/PackageVersionConstraint.hs view
@@ -26,7 +26,7 @@ -- There are a few places in the codebase where 'Dependency' was used where -- 'PackageVersionConstraint' is not used instead (#5570). data PackageVersionConstraint = PackageVersionConstraint PackageName VersionRange- deriving (Generic, Read, Show, Eq, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Data) instance Binary PackageVersionConstraint instance Structured PackageVersionConstraint
src/Distribution/Types/PkgconfigDependency.hs view
@@ -23,7 +23,7 @@ = PkgconfigDependency PkgconfigName PkgconfigVersionRange- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary PkgconfigDependency instance Structured PkgconfigDependency
src/Distribution/Types/PkgconfigName.hs view
@@ -24,7 +24,7 @@ -- -- @since 2.0.0.2 newtype PkgconfigName = PkgconfigName ShortText- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) -- | Convert 'PkgconfigName' to 'String' --
src/Distribution/Types/PkgconfigVersion.hs view
@@ -26,7 +26,7 @@ -- -- @since 3.0 newtype PkgconfigVersion = PkgconfigVersion BS.ByteString- deriving (Generic, Read, Show, Typeable, Data)+ deriving (Generic, Read, Show, Data) instance Eq PkgconfigVersion where PkgconfigVersion a == PkgconfigVersion b = rpmvercmp a b == EQ
src/Distribution/Types/PkgconfigVersionRange.hs view
@@ -37,7 +37,7 @@ | PcOrEarlierVersion PkgconfigVersion -- =< version | PcUnionVersionRanges PkgconfigVersionRange PkgconfigVersionRange | PcIntersectVersionRanges PkgconfigVersionRange PkgconfigVersionRange- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)+ deriving (Generic, Read, Show, Eq, Ord, Data) instance Binary PkgconfigVersionRange instance Structured PkgconfigVersionRange
src/Distribution/Types/SetupBuildInfo.hs view
@@ -25,7 +25,7 @@ -- internally, and doesn't correspond to anything in the .cabal -- file. See #3199. }- deriving (Generic, Show, Eq, Ord, Read, Typeable, Data)+ deriving (Generic, Show, Eq, Ord, Read, Data) instance Binary SetupBuildInfo instance Structured SetupBuildInfo
src/Distribution/Types/SourceRepo.hs view
@@ -77,7 +77,7 @@ -- relative to the root of the repository. This field is optional. If not -- given the default is \".\" ie no subdirectory. }- deriving (Eq, Ord, Generic, Read, Show, Typeable, Data)+ deriving (Eq, Ord, Generic, Read, Show, Data) emptySourceRepo :: RepoKind -> SourceRepo emptySourceRepo kind =@@ -106,7 +106,7 @@ -- information to re-create the exact sources. RepoThis | RepoKindUnknown String- deriving (Eq, Generic, Ord, Read, Show, Typeable, Data)+ deriving (Eq, Generic, Ord, Read, Show, Data) instance Binary RepoKind instance Structured RepoKind@@ -126,7 +126,7 @@ | Monotone | -- | @since 3.4.0.0 Pijul- deriving (Eq, Generic, Ord, Read, Show, Typeable, Data, Enum, Bounded)+ deriving (Eq, Generic, Ord, Read, Show, Data, Enum, Bounded) instance Binary KnownRepoType instance Structured KnownRepoType@@ -146,7 +146,7 @@ data RepoType = KnownRepoType KnownRepoType | OtherRepoType String- deriving (Eq, Generic, Ord, Read, Show, Typeable, Data)+ deriving (Eq, Generic, Ord, Read, Show, Data) instance Binary RepoType instance Structured RepoType
src/Distribution/Types/TestSuite.hs view
@@ -28,7 +28,7 @@ , testBuildInfo :: BuildInfo , testCodeGenerators :: [String] }- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance L.HasBuildInfo TestSuite where buildInfo f l = (\x -> l{testBuildInfo = x}) <$> f (testBuildInfo l)
src/Distribution/Types/TestSuiteInterface.hs view
@@ -30,7 +30,7 @@ | -- | A test suite that does not conform to one of the above interfaces for -- the given reason (e.g. unknown test type). TestSuiteUnsupported TestType- deriving (Eq, Ord, Generic, Read, Show, Typeable, Data)+ deriving (Eq, Ord, Generic, Read, Show, Data) instance Binary TestSuiteInterface instance Structured TestSuiteInterface
src/Distribution/Types/TestType.hs view
@@ -25,7 +25,7 @@ TestTypeLib Version | -- | Some unknown test type e.g. \"type: foo\" TestTypeUnknown String Version- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary TestType instance Structured TestType
src/Distribution/Types/UnitId.hs view
@@ -64,7 +64,7 @@ -- flag, use the 'display' function, which will work on all -- versions of Cabal. newtype UnitId = UnitId ShortText- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data, NFData)+ deriving (Generic, Read, Show, Eq, Ord, Data, NFData) instance Binary UnitId instance Structured UnitId@@ -118,7 +118,7 @@ -- that a 'UnitId' identified this way is definite; i.e., it has no -- unfilled holes. newtype DefUnitId = DefUnitId {unDefUnitId :: UnitId}- deriving (Generic, Read, Show, Eq, Ord, Typeable, Data, Binary, NFData, Pretty)+ deriving (Generic, Read, Show, Eq, Ord, Data, Binary, NFData, Pretty) instance Structured DefUnitId
src/Distribution/Types/UnqualComponentName.hs view
@@ -33,7 +33,6 @@ , Show , Eq , Ord- , Typeable , Data , Semigroup , Monoid -- TODO: bad enabler of bad monoids
src/Distribution/Types/Version.hs view
@@ -47,7 +47,7 @@ -- which all fall into the [0..0xfffe] range), then PV0 -- MUST be used. This is essential for the 'Eq' instance -- to work.- deriving (Data, Eq, Generic, Typeable)+ deriving (Data, Eq, Generic) instance Ord Version where compare (PV0 x) (PV0 y) = compare x y
src/Distribution/Types/VersionInterval.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE BangPatterns #-}-{-# LANGUAGE DeriveDataTypeable #-} -- | This module implements a view of a 'VersionRange' as a finite -- list of separated version intervals.@@ -65,7 +64,7 @@ -- predicates for translation into foreign packaging systems that do not -- support complex version range expressions. newtype VersionIntervals = VersionIntervals [VersionInterval]- deriving (Eq, Show, Typeable)+ deriving (Eq, Show) -- | Inspect the list of version intervals. unVersionIntervals :: VersionIntervals -> [VersionInterval]
src/Distribution/Types/VersionInterval/Legacy.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE DeriveDataTypeable #-}- -- | This module implements a view of a 'VersionRange' as a finite -- list of separated version intervals and provides the Boolean -- algebra operations union, intersection, and complement.@@ -96,7 +94,7 @@ -- predicates for translation into foreign packaging systems that do not -- support complex version range expressions. newtype VersionIntervals = VersionIntervals [VersionInterval]- deriving (Eq, Show, Typeable)+ deriving (Eq, Show) -- | Inspect the list of version intervals. versionIntervals :: VersionIntervals -> [VersionInterval]
src/Distribution/Types/VersionRange.hs view
@@ -1,7 +1,26 @@+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE ViewPatterns #-}+ module Distribution.Types.VersionRange- ( -- * Version ranges+ ( -- * Version Range VersionRange + -- ** Predicates+ -- $predicate-examples++ -- *** Lower Bound+ , hasLowerBound+ , hasGTLowerBound++ -- *** Upper Bound+ , hasUpperBound+ , hasLEUpperBound+ , hasTrailingZeroUpperBound++ -- *** Any Version+ , isAnyVersion+ , isAnyVersionLight+ -- ** Constructing , anyVersion , noVersion@@ -16,32 +35,31 @@ , withinVersion , majorBoundVersion - -- ** Inspection+ -- ** Modification+ , normaliseVersionRange+ , stripParensVersionRange - --- -- See "Distribution.Version" for more utilities.+ -- ** Inspection , withinRange , foldVersionRange- , normaliseVersionRange- , stripParensVersionRange- , hasUpperBound- , hasLowerBound - -- ** Cata & ana+ -- ** Parser+ , versionRangeParser++ -- * Version F-Algebra , VersionRangeF (..)+ , projectVersionRange+ , embedVersionRange , cataVersionRange , anaVersionRange , hyloVersionRange- , projectVersionRange- , embedVersionRange - -- ** Utilities- , isAnyVersion- , isAnyVersionLight+ -- * Version Utilities++ -- See "Distribution.Version" for more utilities. , wildcardUpperBound , majorUpperBound , isWildcardRange- , versionRangeParser ) where import Distribution.Compat.Prelude@@ -172,6 +190,9 @@ -- | Does the version range have an upper bound? -- -- @since 1.24.0.0+--+-- >>> forM ["< 1", ">= 0 && < 1", ">= 0 || < 1", "^>= 4.20.0.0"] (fmap hasUpperBound . simpleParsec)+-- Just [True,True,False,True] hasUpperBound :: VersionRange -> Bool hasUpperBound = foldVersionRange@@ -188,6 +209,9 @@ -- the implicit >=0 lower bound. -- -- @since 1.24.0.0+--+-- >>> forM ["< 1", ">= 0 && < 1", ">= 0 || < 1", "^>= 4.20.0.0"] (fmap hasLowerBound . simpleParsec)+-- Just [False,True,False,True] hasLowerBound :: VersionRange -> Bool hasLowerBound = foldVersionRange@@ -197,3 +221,50 @@ (const False) (&&) (||)++-- | Is the upper bound version range (less than or equal (LE, <=)?+--+-- >>> forM ["< 1", "<= 1", ">= 0 && < 1", ">= 0 || < 1", ">= 0 && <= 1", ">= 0 || <= 1", "^>= 4.20.0.0"] (fmap hasLEUpperBound . simpleParsec)+-- Just [False,True,False,False,True,True,False]+hasLEUpperBound :: VersionRange -> Bool+hasLEUpperBound = queryVersionRange (\case LEUpperBound -> True; _ -> False) hasLEUpperBound++-- | Is the lower bound version range greater than (GT, >)?+--+-- >>> forM ["< 1", ">= 0 && < 1", ">= 0 || < 1", "> 0 && < 1", "> 0 || < 1", "^>= 4.20.0.0"] (fmap hasGTLowerBound . simpleParsec)+-- Just [False,False,False,True,True,False]+hasGTLowerBound :: VersionRange -> Bool+hasGTLowerBound = queryVersionRange (\case GTLowerBound -> True; _ -> False) hasGTLowerBound++-- | Does the upper bound version range have a trailing zero?+--+-- >>> forM ["< 1", "< 1.1", "< 1.0", "< 1.1.0", "^>= 4.20.0.0"] (fmap hasTrailingZeroUpperBound . simpleParsec)+-- Just [False,False,True,True,False]+hasTrailingZeroUpperBound :: VersionRange -> Bool+hasTrailingZeroUpperBound = queryVersionRange (\case TZUpperBound -> True; _ -> False) hasTrailingZeroUpperBound++queryVersionRange :: (VersionRangeF VersionRange -> Bool) -> (VersionRange -> Bool) -> VersionRange -> Bool+queryVersionRange pf p (projectVersionRange -> v) =+ let f = queryVersionRange pf p+ in pf v || case v of+ IntersectVersionRangesF x y -> f x || f y+ UnionVersionRangesF x y -> f x || f y+ _ -> False++-- $setup+-- >>> import Distribution.Parsec+-- >>> import Data.Traversable++-- $predicate-examples+--+-- The parsed 'VersionRange' of each version constraint used in the examples for+-- 'hasUpperBound' and 'hasLowerBound' are:+--+-- >>> simpleParsec "< 1" :: Maybe VersionRange+-- Just (EarlierVersion (mkVersion [1]))+-- >>> simpleParsec ">= 0 && < 1" :: Maybe VersionRange+-- Just (IntersectVersionRanges (OrLaterVersion (mkVersion [0])) (EarlierVersion (mkVersion [1])))+-- >>> simpleParsec ">= 0 || < 1" :: Maybe VersionRange+-- Just (UnionVersionRanges (OrLaterVersion (mkVersion [0])) (EarlierVersion (mkVersion [1])))+-- >>> simpleParsec "^>= 4.20.0.0" :: Maybe VersionRange+-- Just (MajorBoundVersion (mkVersion [4,20,0,0]))
src/Distribution/Types/VersionRange/Internal.hs view
@@ -5,7 +5,9 @@ {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE ViewPatterns #-} -- | The only purpose of this module is to prevent the export of -- 'VersionRange' constructors from@@ -25,7 +27,7 @@ , intersectVersionRanges , withinVersion , majorBoundVersion- , VersionRangeF (..)+ , VersionRangeF (.., LEUpperBound, GTLowerBound, TZUpperBound) , projectVersionRange , embedVersionRange , cataVersionRange@@ -58,7 +60,7 @@ | MajorBoundVersion Version -- @^>= ver@ (same as >= ver && < MAJ(ver)+1) | UnionVersionRanges VersionRange VersionRange | IntersectVersionRanges VersionRange VersionRange- deriving (Data, Eq, Ord, Generic, Read, Show, Typeable)+ deriving (Data, Eq, Ord, Generic, Read, Show) instance Binary VersionRange instance Structured VersionRange@@ -181,11 +183,26 @@ , Generic , Read , Show- , Typeable , Functor , Foldable , Traversable )++pattern LEUpperBound, GTLowerBound, TZUpperBound :: VersionRangeF a+pattern LEUpperBound <- OrEarlierVersionF _+pattern GTLowerBound <- LaterVersionF _+pattern TZUpperBound <- (upperTrailingZero -> True)++upperTrailingZero :: VersionRangeF a -> Bool+upperTrailingZero (OrEarlierVersionF x) = trailingZero x+upperTrailingZero (EarlierVersionF x) = trailingZero x+upperTrailingZero _ = False++trailingZero :: Version -> Bool+trailingZero (versionNumbers -> vs)+ | [0] <- vs = False+ | 0 : _ <- reverse vs = True+ | otherwise = False -- | Generic destructor for 'VersionRange'. --
src/Distribution/Utils/Generic.hs view
@@ -1,11 +1,7 @@ {-# LANGUAGE BangPatterns #-}-{-# LANGUAGE CPP #-}-{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-}------------------------------------------------------------------------------- -- | -- Module : Distribution.Utils.Generic
src/Distribution/Utils/Path.hs view
@@ -201,7 +201,7 @@ -- until we interpret them (using e.g. 'interpretSymbolicPath'). newtype SymbolicPathX (allowAbsolute :: AllowAbsolute) (from :: Type) (to :: FileOrDir) = SymbolicPath FilePath- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) type role SymbolicPathX nominal nominal nominal
src/Distribution/Utils/ShortText.hs view
@@ -93,7 +93,7 @@ -- @since 2.0.0.2 #if HAVE_SHORTBYTESTRING newtype ShortText = ST { unST :: BS.Short.ShortByteString }- deriving (Eq,Ord,Generic,Data,Typeable)+ deriving (Eq,Ord,Generic,Data) # if MIN_VERSION_binary(0,8,1) instance Binary ShortText where@@ -115,7 +115,7 @@ null = BS.Short.null . unST #else newtype ShortText = ST { unST :: String }- deriving (Eq,Ord,Generic,Data,Typeable)+ deriving (Eq,Ord,Generic,Data) instance Binary ShortText where put = put . encodeStringUtf8 . unST
src/Distribution/Version.hs view
@@ -50,6 +50,9 @@ , stripParensVersionRange , hasUpperBound , hasLowerBound+ , hasLEUpperBound+ , hasTrailingZeroUpperBound+ , hasGTLowerBound -- ** Cata & ana , VersionRangeF (..)
src/Language/Haskell/Extension.hs view
@@ -59,7 +59,7 @@ GHC2024 | -- | An unknown language, identified by its name. UnknownLanguage String- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary Language instance Structured Language@@ -115,7 +115,7 @@ | -- | An unknown extension, identified by the name of its @LANGUAGE@ -- pragma. UnknownExtension String- deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Data) instance Binary Extension instance Structured Extension@@ -556,7 +556,7 @@ | -- | Allow use of or-pattern syntax, condensing multiple patterns -- into a single one. OrPatterns- deriving (Generic, Show, Read, Eq, Ord, Enum, Bounded, Typeable, Data)+ deriving (Generic, Show, Read, Eq, Ord, Enum, Bounded, Data) instance Binary KnownExtension instance Structured KnownExtension