X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcTyFuns.lhs;h=4be39c37c7850e2740ff5ad7e4a128d542f8b518;hp=c91ac63e19b917770fdad042cdcbb1c0c27fa531;hb=4ba96c06f2b69ea1fe2b27718013713e94c1520c;hpb=0bca9b76899d5baab892d26d6054db5b7189392c;ds=sidebyside diff --git a/compiler/typecheck/TcTyFuns.lhs b/compiler/typecheck/TcTyFuns.lhs index c91ac63..4be39c3 100644 --- a/compiler/typecheck/TcTyFuns.lhs +++ b/compiler/typecheck/TcTyFuns.lhs @@ -8,9 +8,6 @@ -- for details module TcTyFuns( - finalizeEqInst, - partitionWantedEqInsts, partitionGivenEqInsts, - tcNormalizeFamInst, normaliseGivens, normaliseGivenDicts, @@ -46,49 +43,6 @@ import Maybes import Data.List \end{code} -%************************************************************************ -%* * -\section{Eq Insts} -%* * -%************************************************************************ - -%************************************************************************ -%* * -\section{Utility Code} -%* * -%************************************************************************ - -\begin{code} -partitionWantedEqInsts - :: [Inst] -- wanted insts - -> ([Inst],[Inst]) -- (wanted equations,wanted dicts) -partitionWantedEqInsts = partitionEqInsts True - -partitionGivenEqInsts - :: [Inst] -- given insts - -> ([Inst],[Inst]) -- (given equations,given dicts) -partitionGivenEqInsts = partitionEqInsts False - - -partitionEqInsts - :: Bool -- <=> wanted - -> [Inst] -- insts - -> ([Inst],[Inst]) -- (equations,dicts) -partitionEqInsts wanted [] - = ([],[]) -partitionEqInsts wanted (i:is) - | isEqInst i - = (i:es,ds) - | otherwise - = (es,i:ds) - where (es,ds) = partitionEqInsts wanted is - -isEqDict :: Inst -> Bool -isEqDict (Dict {tci_pred = EqPred _ _}) = True -isEqDict _ = False - -\end{code} - %************************************************************************ %* * @@ -503,8 +457,10 @@ trivialInsts (i@(EqInst {}):is) -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ swapInsts :: [Inst] -> TcM ([Inst],Bool) -- All the inputs and outputs are equalities -swapInsts insts = mapAndUnzipM swapInst insts >>= \(insts',changeds) -> return (insts',or changeds) - +swapInsts insts + = do { (insts', changeds) <- mapAndUnzipM swapInst insts + ; return (insts', or changeds) + } -- (Swap) -- g1 : c ~ Fd