@@ -164,7 +164,9 @@ genClauses fc n xs given
164164 (p : _) -> p
165165 _ -> repeat (pexp Placeholder)
166166 let tryclauses = mkClauses parg all_args
167− let new = mnub i $ filter (noMatch i) tryclauses
167+ logLvl 2 $ show (length tryclauses) ++ " initially to check"
168+ let new = mnub i $ filter (noMatch i) tryclauses
169+ logLvl 1 $ show (length new) ++ " clauses to check for impossibility"
168170 logLvl 7 $ "New clauses: \n" ++ showSep "\n" (map (showImp True) new)
169171-- ++ " from:\n" ++ showSep "\n" (map (showImp True) tryclauses)
170172 return new
@@ -202,13 +204,18 @@ genClauses fc n xs given
202204 as' <- mkArg as
203205 return (a':as')
204206
207+fnub xs = fnub' [] xs where
208+ fnub' acc (x : xs) | x `elem` acc = fnub' acc xs
209+ | otherwise = fnub' (x : acc) xs
210+ fnub' acc [] = acc
211+
205212-- FIXME: Just look for which one is the deepest, then generate all
206213-- possibilities up to that depth.
207214
208215genAll :: IState -> [PTerm] -> [PTerm]
209216genAll i args = case filter (/=Placeholder) $ concatMap otherPats (nub args) of
210217 [] -> [Placeholder]
211− xs -> xs
218+ xs -> nub xs
212219 where
213220 conForm (PApp _ (PRef fc n) _) = isConName Nothing n (tt_ctxt i)
214221 conForm (PRef fc n) = isConName Nothing n (tt_ctxt i)