@@ -164,7 +164,9 @@ genClauses fc n xs given
164 (p : _) -> p
164 (p : _) -> p
165 _ -> repeat (pexp Placeholder)
165 _ -> repeat (pexp Placeholder)
166 let tryclauses = mkClauses parg all_args
166 let tryclauses = mkClauses parg all_args
167+ logLvl 2 $ show (length tryclauses) ++ " initially to check"
167− let new = mnub i $ filter (noMatch i) tryclauses
168+ let new = mnub i $ filter (noMatch i) tryclauses
169+ logLvl 1 $ show (length new) ++ " clauses to check for impossibility"
168 logLvl 7 $ "New clauses: \n" ++ showSep "\n" (map (showImp True) new)
170 logLvl 7 $ "New clauses: \n" ++ showSep "\n" (map (showImp True) new)
169-- ++ " from:\n" ++ showSep "\n" (map (showImp True) tryclauses)
171-- ++ " from:\n" ++ showSep "\n" (map (showImp True) tryclauses)
170 return new
172 return new
@@ -202,13 +204,18 @@ genClauses fc n xs given
202 as' <- mkArg as
204 as' <- mkArg as
203 return (a':as')
205 return (a':as')
207+fnub xs = fnub' [] xs where
208+ fnub' acc (x : xs) | x `elem` acc = fnub' acc xs
209+ | otherwise = fnub' (x : acc) xs
205-- FIXME: Just look for which one is the deepest, then generate all
212-- FIXME: Just look for which one is the deepest, then generate all
206-- possibilities up to that depth.
213-- possibilities up to that depth.
208genAll :: IState -> [PTerm] -> [PTerm]
215genAll :: IState -> [PTerm] -> [PTerm]
209genAll i args = case filter (/=Placeholder) $ concatMap otherPats (nub args) of
216genAll i args = case filter (/=Placeholder) $ concatMap otherPats (nub args) of
210 [] -> [Placeholder]
217 [] -> [Placeholder]
211− xs -> xs
218+ xs -> nub xs
213 conForm (PApp _ (PRef fc n) _) = isConName Nothing n (tt_ctxt i)
220 conForm (PApp _ (PRef fc n) _) = isConName Nothing n (tt_ctxt i)
214 conForm (PRef fc n) = isConName Nothing n (tt_ctxt i)
221 conForm (PRef fc n) = isConName Nothing n (tt_ctxt i)