@@ -761,11 +761,15 @@ runTac autoSolve ist tac
761761 runT (Exact tm) = do elab ist toplevel False False (MN 0 "tac") tm
762762 when autoSolve solveAll
763763 runT (MatchRefine fn)
764− = do (fn', imps) <- case lookupCtxtName fn (idris_implicits ist) of
765− [] -> do a <- envArgs fn
766− return (fn, a)
767− [(n, args)] -> return $ (n, map (const True) args)
768− ns <- match_apply (Var fn') (map (\x -> (x, 0)) imps)
764+ = do fnimps <-
765+ case lookupCtxtName fn (idris_implicits ist) of
766+ [] -> do a <- envArgs fn
767+ return [(fn, a)]
768+ ns -> return (map (\ (n, a) -> (n, map (const True) a)) ns)
769+ let tacs = map (\ (fn', imps) ->
770+ (match_apply (Var fn') (map (\x -> (x, 0)) imps),
771+ show fn')) fnimps
772+ tryAll tacs
769773 when autoSolve solveAll
770774 where envArgs n = do e <- get_env
771775 case lookup n e of
@@ -773,12 +777,15 @@ runTac autoSolve ist tac
773777 (getArgTys (binderTy t))
774778 _ -> return []
775779 runT (Refine fn [])
776− = do (fn', imps) <- case lookupCtxtName fn (idris_implicits ist) of
777− [] -> do a <- envArgs fn
778− return (fn, a)
779− -- FIXME: resolve ambiguities
780− [(n, args)] -> return $ (n, map isImp args)
781− ns <- apply (Var fn') (map (\x -> (x, 0)) imps)
780+ = do fnimps <-
781+ case lookupCtxtName fn (idris_implicits ist) of
782+ [] -> do a <- envArgs fn
783+ return [(fn, a)]
784+ ns -> return (map (\ (n, a) -> (n, map isImp a)) ns)
785+ let tacs = map (\ (fn', imps) ->
786+ (apply (Var fn') (map (\x -> (x, 0)) imps),
787+ show fn')) fnimps
788+ tryAll tacs
782789 when autoSolve solveAll
783790 where isImp (PImp _ _ _ _ _) = True
784791 isImp _ = False