@@ -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