Skip to content
Snippets Groups Projects
Commit a44994e3 authored by Edsko de Vries's avatar Edsko de Vries
Browse files

Move varPI to where Var is defined.

Addresses https://github.com/haskell/cabal/pull/2500#commitcomment-10798623
parent d9231148
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ module Distribution.Client.Dependency.Modular.Dependency (
Var(..)
, simplifyVar
, showVar
, varPI
-- * Conflict sets
, ConflictSet
, showCS
......@@ -94,6 +95,12 @@ showVar (P qpn) = showQPN qpn
showVar (F qfn) = showQFN qfn
showVar (S qsn) = showQSN qsn
-- | Extract the package instance from a Var
varPI :: Var QPN -> (QPN, Maybe I)
varPI (P qpn) = (qpn, Nothing)
varPI (F (FN (PI qpn i) _)) = (qpn, Just i)
varPI (S (SN (PI qpn i) _)) = (qpn, Just i)
{-------------------------------------------------------------------------------
Conflict sets
-------------------------------------------------------------------------------}
......
......@@ -459,12 +459,6 @@ lgAddMember qpn@(Q pp pn) i lg = do
Auxiliary
-------------------------------------------------------------------------------}
-- | Extract the package instance from a Var
varPI :: Var QPN -> (QPN, Maybe I)
varPI (P qpn) = (qpn, Nothing)
varPI (F (FN (PI qpn i) _)) = (qpn, Just i)
varPI (S (SN (PI qpn i) _)) = (qpn, Just i)
allEqual :: Eq a => [a] -> Bool
allEqual [] = True
allEqual [_] = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment