Skip to content

Commit

Permalink
fix: remove unused and buggy instances of semigroup for dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
theobat committed Nov 15, 2023
1 parent e5b6344 commit 0c93019
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/Stack/Types/Dependency.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module Stack.Types.Dependency
import qualified Distribution.PackageDescription as Cabal
import Distribution.Types.VersionRange ( VersionRange )
import Stack.Prelude
import Stack.Types.Version ( intersectVersionRanges )

-- | The value for a map from dependency name. This contains both the version
-- range and the type of dependency, and provides a semigroup instance.
Expand All @@ -20,9 +19,6 @@ data DepValue = DepValue
}
deriving (Show, Typeable)

instance Semigroup DepValue where
DepValue a x <> DepValue b y = DepValue (intersectVersionRanges a b) (x <> y)

-- | Is this package being used as a library, or just as a build tool? If the
-- former, we need to ensure that a library actually exists. See
-- <https://github.com/commercialhaskell/stack/issues/2195>
Expand All @@ -31,10 +27,6 @@ data DepType
| AsBuildTool
deriving (Eq, Show)

instance Semigroup DepType where
AsLibrary <> _ = AsLibrary
AsBuildTool <> x = x

cabalToStackDep :: Cabal.Dependency -> DepValue
cabalToStackDep (Cabal.Dependency _ verRange _libNameSet) =
DepValue{dvVersionRange = verRange, dvType = AsLibrary}
Expand Down

0 comments on commit 0c93019

Please sign in to comment.