diff --git a/cabal-install/Distribution/Client/BuildTarget.hs b/cabal-install/Distribution/Client/BuildTarget.hs index 673c89546f4..1fe25b1c217 100644 --- a/cabal-install/Distribution/Client/BuildTarget.hs +++ b/cabal-install/Distribution/Client/BuildTarget.hs @@ -665,6 +665,8 @@ reportBuildTargetProblems problems = do [ "Unknown build target '" ++ showUserBuildTarget target ++ "'.\n" ++ unlines [ (case inside of + Just (kind, "") + -> "The " ++ kind ++ " has no " Just (kind, thing) -> "The " ++ kind ++ " " ++ thing ++ " has no " Nothing -> "There is no ") @@ -1663,6 +1665,8 @@ forceInexact m = m -- but if we have multiple exact, or inexact then the we collect all the -- ambiguous matches. -- +-- This operator is associative, has unit 'mzero' and is also commutative. +-- matchPlus :: Match a -> Match a -> Match a matchPlus (ExactMatch d1 xs) (ExactMatch d2 xs') = ExactMatch (max d1 d2) (xs ++ xs') @@ -1683,6 +1687,8 @@ matchPlus a@(NoMatch d1 ms) b@(NoMatch d2 ms') -- difference that an exact match from the left matcher shadows any exact -- match on the right. Inexact matches are still collected however. -- +-- This operator is associative, has unit 'mzero' and is not commutative. +-- matchPlusShadowing :: Match a -> Match a -> Match a matchPlusShadowing a@(ExactMatch _ _) _ = a matchPlusShadowing a b = matchPlus a b @@ -1812,7 +1818,8 @@ caseFold = lowercase {- ex1pinfo :: [PackageInfo] ex1pinfo = - [ PackageInfo { + [ addComponent (CExeName (mkUnqualComponentName "foo-exe")) [] ["Data.Foo"] $ + PackageInfo { pinfoId = PackageIdentifier (mkPackageName "foo") (mkVersion [1]), pinfoLocation = LocalUnpackedPackage "/the/foo", pinfoDirectory = Just ("/the/foo", "foo"), @@ -1827,6 +1834,18 @@ ex1pinfo = pinfoComponents = [] } ] + where + addComponent n ds ms p = + p { + pinfoComponents = + ComponentInfo n (componentStringName (pinfoId p) n) + p ds (map mkMn ms) + [] [] [] + : pinfoComponents p + } + + mkMn :: String -> ModuleName + mkMn = ModuleName.fromString -} {- stargets =