Commit 196fc759 authored by RyanGlScott's avatar RyanGlScott

Fix "ambigious" typos

parent d9b45c86
......@@ -261,7 +261,7 @@ resolveBuildTarget :: PackageDescription -> UserBuildTarget -> Bool
resolveBuildTarget pkg userTarget fexists =
case findMatch (matchBuildTarget pkg userTarget fexists) of
Unambiguous target -> Right target
Ambiguous targets -> Left (BuildTargetAmbigious userTarget targets')
Ambiguous targets -> Left (BuildTargetAmbiguous userTarget targets')
where targets' = disambiguateBuildTargets
(packageId pkg) userTarget
targets
......@@ -283,7 +283,7 @@ data BuildTargetProblem
-- ^ [expected thing] (actually got)
| BuildTargetNoSuch UserBuildTarget [(String, String)]
-- ^ [(no such thing, actually got)]
| BuildTargetAmbigious UserBuildTarget [(UserBuildTarget, BuildTarget)]
| BuildTargetAmbiguous UserBuildTarget [(UserBuildTarget, BuildTarget)]
deriving Show
......@@ -362,7 +362,7 @@ reportBuildTargetProblems problems = do
mungeThing "file" = "file target"
mungeThing thing = thing
case [ (t, ts) | BuildTargetAmbigious t ts <- problems ] of
case [ (t, ts) | BuildTargetAmbiguous t ts <- problems ] of
[] -> return ()
targets ->
die $ unlines
......@@ -730,10 +730,10 @@ matchDirectoryPrefix dirs filepath =
--
-- | A matcher embodies a way to match some input as being some recognised
-- value. In particular it deals with multiple and ambigious matches.
-- value. In particular it deals with multiple and ambiguous matches.
--
-- There are various matcher primitives ('matchExactly', 'matchInexactly'),
-- ways to combine matchers ('ambigiousWith', 'shadows') and finally we can
-- ways to combine matchers ('ambiguousWith', 'shadows') and finally we can
-- run a matcher against an input using 'findMatch'.
--
......@@ -762,7 +762,7 @@ matchZero = NoMatch 0 []
-- | Combine two matchers. Exact matches are used over inexact matches
-- but if we have multiple exact, or inexact then the we collect all the
-- ambiguous matches.
--
matchPlus :: Match a -> Match a -> Match a
matchPlus (ExactMatch d1 xs) (ExactMatch d2 xs') =
......@@ -780,7 +780,7 @@ matchPlus a@(NoMatch d1 ms) b@(NoMatch d2 ms')
| d1 < d2 = b
| otherwise = NoMatch d1 (ms ++ ms')
-- | Combine two matchers. This is similar to 'ambigiousWith' with the
-- | Combine two matchers. This is similar to 'ambiguousWith' with the
-- difference that an exact match from the left matcher shadows any exact
-- match on the right. Inexact matches are still collected however.
--
......@@ -868,18 +868,18 @@ tryEach = exactMatches
-- possible matches. There may be 'None', a single 'Unambiguous' match or
-- you may have an 'Ambiguous' match with several possibilities.
--
findMatch :: Eq b => Match b -> MaybeAmbigious b
findMatch :: Eq b => Match b -> MaybeAmbiguous b
findMatch match =
case match of
NoMatch _ msgs -> None (nub msgs)
ExactMatch _ xs -> checkAmbigious xs
InexactMatch _ xs -> checkAmbigious xs
ExactMatch _ xs -> checkAmbiguous xs
InexactMatch _ xs -> checkAmbiguous xs
where
checkAmbigious xs = case nub xs of
checkAmbiguous xs = case nub xs of
[x] -> Unambiguous x
xs' -> Ambiguous xs'
data MaybeAmbigious a = None [MatchError] | Unambiguous a | Ambiguous [a]
data MaybeAmbiguous a = None [MatchError] | Unambiguous a | Ambiguous [a]
deriving Show
......
......@@ -1431,7 +1431,7 @@ resolveModuleReexports installedPackages srcpkgid externalPkgDeps lib =
-- Note: if in future Cabal allows directly depending on multiple
-- instances of the same package (e.g. backpack) then an additional
-- ambiguity case is possible here: (_, Just originalPackageName)
-- with the module being ambigious despite being qualified by a
-- with the module being ambiguous despite being qualified by a
-- package name. Presumably by that time we'll have a mechanism to
-- qualify the instance we're referring to.
......
......@@ -550,7 +550,7 @@ readPackageTarget verbosity target = case target of
data PackageTargetProblem
= PackageNameUnknown PackageName UserTarget
| PackageNameAmbigious PackageName [PackageName] UserTarget
| PackageNameAmbiguous PackageName [PackageName] UserTarget
deriving Show
......@@ -578,7 +578,7 @@ disambiguatePackageTargets availablePkgIndex availableExtra targets =
case disambiguatePackageName packageNameEnv pkgname of
None -> Left (PackageNameUnknown
pkgname userTarget)
Ambiguous pkgnames -> Left (PackageNameAmbigious
Ambiguous pkgnames -> Left (PackageNameAmbiguous
pkgname pkgnames userTarget)
Unambiguous pkgname' -> Right (NamedPackage pkgname' constraints')
where
......@@ -604,11 +604,11 @@ reportPackageTargetProblems verbosity problems = do
++ "You may need to run 'cabal update' to get the latest "
++ "list of available packages."
case [ (pkg, matches) | PackageNameAmbigious pkg matches _ <- problems ] of
case [ (pkg, matches) | PackageNameAmbiguous pkg matches _ <- problems ] of
[] -> return ()
ambiguities -> die $ unlines
[ "The package name '" ++ display name
++ "' is ambigious. It could be: "
++ "' is ambiguous. It could be: "
++ intercalate ", " (map display matches)
| (name, matches) <- ambiguities ]
......@@ -627,17 +627,17 @@ reportPackageTargetProblems verbosity problems = do
-- * Disambiguating package names
-- ------------------------------------------------------------
data MaybeAmbigious a = None | Unambiguous a | Ambiguous [a]
data MaybeAmbiguous a = None | Unambiguous a | Ambiguous [a]
-- | Given a package name and a list of matching names, figure out which one it
-- might be referring to. If there is an exact case-sensitive match then that's
-- ok. If it matches just one package case-insensitively then that's also ok.
-- The only problem is if it matches multiple packages case-insensitively, in
-- that case it is ambigious.
-- that case it is ambiguous.
--
disambiguatePackageName :: PackageNameEnv
-> PackageName
-> MaybeAmbigious PackageName
-> MaybeAmbiguous PackageName
disambiguatePackageName (PackageNameEnv pkgNameLookup) name =
case nub (pkgNameLookup name) of
[] -> None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment