on master help sign in
Disable PAny for repeated patvars.
commit15b9807b3350522ded5bb9e2f33ea68d0d24942b authorMatus Tejiscak <ziman@functor.sk> dateSun 6 Jul 2014, 00:46 (12 years ago) parent2490a15
1 file changed+8
src/Idris/Core/CaseTree.hs+8
src/Idris/Core/CaseTree.hs+8
@@ -368,12 +368,20 @@ toPat reflect tc tms = evalState (mapM (\x -> toPat' x []) tms) []
368368-- | tc = return $ PCon (UN "Integer") 6 []
369369-- toPat' (Constant (AType (ATInt (ITFixed n)))) []
370370-- | tc = return $ PCon (UN (fixedN n)) (7 + fromEnum n) [] -- 7-10 inclusive
371+--
372+{-
371373 toPat' (P Bound n ty) [] = -- trace (show (n, ty)) $
372374 do ns <- get
373375 if n `elem` ns
374376 then return PAny
375377 else do put (n : ns)
376378 return (PV n ty)
379+-}
380+ toPat' (P Bound n ty) [] = do
381+ ns <- get
382+ put $ nub (n : ns)
383+ return (PV n ty)
384+
377385 toPat' (App f a) args = toPat' f (a : args)
378386 toPat' (Constant (AType _)) [] = return PTyPat
379387 toPat' (Constant StrType) [] = return PTyPat