@@ -18,7 +18,7 @@ import Idris.Core.Typecheck (check, recheck)
18import Idris.ErrReverse (errReverse)
18import Idris.ErrReverse (errReverse)
19import Idris.ElabQuasiquote (extractUnquotes)
19import Idris.ElabQuasiquote (extractUnquotes)
20import Idris.Elab.Utils
20import Idris.Elab.Utils
21−import qualified Util.Pretty as U
21+import qualified Util.Pretty as U
23import Control.Applicative ((<$>))
23import Control.Applicative ((<$>))
24import Control.Monad
24import Control.Monad
@@ -76,9 +76,9 @@ build ist info emode opts fn tm
76 u <- getUnifyLog
76 u <- getUnifyLog
77 hs <- get_holes
77 hs <- get_holes
79− when (not pattern) $
79+ when (not pattern) $
80 traceWhen u ("Remaining holes:\n" ++ show hs ++ "\n" ++
80 traceWhen u ("Remaining holes:\n" ++ show hs ++ "\n" ++
81− "Remaining problems:\n" ++ qshow probs) $
81+ "Remaining problems:\n" ++ qshow probs) $
82 do unify_all; matchProblems True; unifyProblems
82 do unify_all; matchProblems True; unifyProblems
84 probs <- get_probs
84 probs <- get_probs
@@ -99,7 +99,7 @@ build ist info emode opts fn tm
99 else return (tm, ds, is)
99 else return (tm, ds, is)
100 where pattern = emode == ELHS
100 where pattern = emode == ELHS
101 tydecl = emode == ETyDecl
101 tydecl = emode == ETyDecl
103 mkPat = do hs <- get_holes
103 mkPat = do hs <- get_holes
104 tm <- get_term
104 tm <- get_term
105 case hs of
105 case hs of
@@ -197,14 +197,14 @@ elab ist info emode opts fn tm
197 -- ++ "\nholes " ++ show hs
197 -- ++ "\nholes " ++ show hs
198 -- ++ "\nproblems " ++ show ps
198 -- ++ "\nproblems " ++ show ps
199 -- ++ "\n-----------\n") $
199 -- ++ "\n-----------\n") $
200− --trace ("ELAB " ++ show t') $
200+ --trace ("ELAB " ++ show t') $
201 let fc = fileFC "Force"
201 let fc = fileFC "Force"
202 env <- get_env
202 env <- get_env
203 handleError (forceErr env)
203 handleError (forceErr env)
204 (elab' ina t')
204 (elab' ina t')
205 (elab' ina (PApp fc (PRef fc (sUN "Force"))
205 (elab' ina (PApp fc (PRef fc (sUN "Force"))
206 [pimp (sUN "t") Placeholder True,
206 [pimp (sUN "t") Placeholder True,
207− pimp (sUN "a") Placeholder True,
207+ pimp (sUN "a") Placeholder True,
208 pexp ct])) True
208 pexp ct])) True
210 forceErr env (CantUnify _ t t' _ _ _)
210 forceErr env (CantUnify _ t t' _ _ _)
@@ -240,9 +240,9 @@ elab ist info emode opts fn tm
240 elab' ina (PNoImplicits t) = elab' ina t -- skip elabE step
240 elab' ina (PNoImplicits t) = elab' ina t -- skip elabE step
241 elab' ina PType = do apply RType []; solve
241 elab' ina PType = do apply RType []; solve
242 elab' ina (PUniverse u) = do apply (RUType u) []; solve
242 elab' ina (PUniverse u) = do apply (RUType u) []; solve
243−-- elab' (_,_,inty) (PConstant c)
243+-- elab' (_,_,inty) (PConstant c)
244-- | constType c && pattern && not reflection && not inty
244-- | constType c && pattern && not reflection && not inty
245−-- = lift $ tfail (Msg "Typecase is not allowed")
245+-- = lift $ tfail (Msg "Typecase is not allowed")
246 elab' ina (PConstant c) = do apply (RConstant c) []; solve
246 elab' ina (PConstant c) = do apply (RConstant c) []; solve
247 elab' ina (PQuote r) = do fill r; solve
247 elab' ina (PQuote r) = do fill r; solve
248 elab' ina (PTrue fc _) =
248 elab' ina (PTrue fc _) =
@@ -338,7 +338,7 @@ elab ist info emode opts fn tm
338-- elab' (_, _, inty) (PRef fc f)
338-- elab' (_, _, inty) (PRef fc f)
339-- | isTConName f (tt_ctxt ist) && pattern && not reflection && not inty
339-- | isTConName f (tt_ctxt ist) && pattern && not reflection && not inty
340-- = lift $ tfail (Msg "Typecase is not allowed")
340-- = lift $ tfail (Msg "Typecase is not allowed")
341− elab' (ina, guarded, inty, qq) (PRef fc n)
341+ elab' (ina, guarded, inty, qq) (PRef fc n)
342 | (pattern || (bindfree && bindable n)) && not (inparamBlock n) && not qq
342 | (pattern || (bindfree && bindable n)) && not (inparamBlock n) && not qq
343 = do ctxt <- get_context
343 = do ctxt <- get_context
344 let defined = case lookupTy n ctxt of
344 let defined = case lookupTy n ctxt of
@@ -363,7 +363,7 @@ elab ist info emode opts fn tm
363 = do -- if n is a type constructor name, this makes no sense...
363 = do -- if n is a type constructor name, this makes no sense...
364 ctxt <- get_context
364 ctxt <- get_context
365 when (isTConName n ctxt) $
365 when (isTConName n ctxt) $
366− lift $ tfail (Msg $ "Can't use type constructor " ++ show n ++ " here")
366+ lift $ tfail (Msg $ "Can't use type constructor " ++ show n ++ " here")
367 checkPiGoal n
367 checkPiGoal n
368 attack; intro (Just n);
368 attack; intro (Just n);
369 -- trace ("------ intro " ++ show n ++ " ---- \n" ++ show ptm)
369 -- trace ("------ intro " ++ show n ++ " ---- \n" ++ show ptm)
@@ -373,7 +373,7 @@ elab ist info emode opts fn tm
373 -- if n is a type constructor name, this makes no sense...
373 -- if n is a type constructor name, this makes no sense...
374 ctxt <- get_context
374 ctxt <- get_context
375 when (isTConName n ctxt) $
375 when (isTConName n ctxt) $
376− lift $ tfail (Msg $ "Can't use type constructor " ++ show n ++ " here")
376+ lift $ tfail (Msg $ "Can't use type constructor " ++ show n ++ " here")
377 checkPiGoal n
377 checkPiGoal n
378 claim tyn RType
378 claim tyn RType
379 explicit tyn
379 explicit tyn
@@ -539,7 +539,7 @@ elab ist info emode opts fn tm
539 sortBy cmpArg (zip ns args)
539 sortBy cmpArg (zip ns args)
540 ulog <- getUnifyLog
540 ulog <- getUnifyLog
541 elabArgs ist (ina || not isinf, guarded, inty, qq)
541 elabArgs ist (ina || not isinf, guarded, inty, qq)
542− [] fc False f ns'
542+ [] fc False f ns'
543 (f == sUN "Force")
543 (f == sUN "Force")
544 (map (\x -> getTm x) eargs) -- TODO: remove this False arg
544 (map (\x -> getTm x) eargs) -- TODO: remove this False arg
@@ -558,7 +558,7 @@ elab ist info emode opts fn tm
558 else movelast n)
558 else movelast n)
559 (ivs' \\ ivs)
559 (ivs' \\ ivs)
560 where -- normal < alternatives < lambdas < rewrites < tactic < default tactic
560 where -- normal < alternatives < lambdas < rewrites < tactic < default tactic
561− -- reason for lambdas after alternatives is that having
561+ -- reason for lambdas after alternatives is that having
562 -- the alternative resolved can help with typechecking the lambda
562 -- the alternative resolved can help with typechecking the lambda
563 -- or the rewrite. Rewrites/tactics need as much information
563 -- or the rewrite. Rewrites/tactics need as much information
564 -- as possible about the type.
564 -- as possible about the type.
@@ -568,7 +568,7 @@ elab ist info emode opts fn tm
568 | constraint x && not (constraint y) = LT
568 | constraint x && not (constraint y) = LT
569 | constraint y && not (constraint x) = GT
569 | constraint y && not (constraint x) = GT
570 | otherwise
570 | otherwise
571− = compare (conDepth 0 (getTm x) + priority x + alt x)
571+ = compare (conDepth 0 (getTm x) + priority x + alt x)
572 (conDepth 0 (getTm y) + priority y + alt y)
572 (conDepth 0 (getTm y) + priority y + alt y)
573 where alt t = case getTm t of
573 where alt t = case getTm t of
574 PAlternative False _ -> 5
574 PAlternative False _ -> 5
@@ -581,14 +581,14 @@ elab ist info emode opts fn tm
582 constraint (PConstraint _ _ _ _) = True
582 constraint (PConstraint _ _ _ _) = True
583 constraint _ = False
583 constraint _ = False
585 -- Score a point for every level where there is a non-constructor
585 -- Score a point for every level where there is a non-constructor
586 -- function (so higher score --> done later)
586 -- function (so higher score --> done later)
587 -- Only relevant when on lhs
587 -- Only relevant when on lhs
588 conDepth d t | not pattern = 0
588 conDepth d t | not pattern = 0
589 conDepth d (PRef _ f) | isConName f (tt_ctxt ist) = 0
589 conDepth d (PRef _ f) | isConName f (tt_ctxt ist) = 0
590 | otherwise = max (100 - d) 1
590 | otherwise = max (100 - d) 1
591− conDepth d (PApp _ f as)
591+ conDepth d (PApp _ f as)
592 = conDepth d f + sum (map (conDepth (d+1)) (map getTm as))
592 = conDepth d f + sum (map (conDepth (d+1)) (map getTm as))
593 conDepth d (PPatvar _ _) = 0
593 conDepth d (PPatvar _ _) = 0
594 conDepth d (PAlternative _ as) = maximum (map (conDepth d) as)
594 conDepth d (PAlternative _ as) = maximum (map (conDepth d) as)
@@ -602,7 +602,7 @@ elab ist info emode opts fn tm
602 Nothing -> return ()
602 Nothing -> return ()
603 Just b ->
603 Just b ->
604 case unApply (binderTy b) of
604 case unApply (binderTy b) of
605− (P _ c _, args) ->
605+ (P _ c _, args) ->
606 case lookupCtxt c (idris_classes ist) of
606 case lookupCtxt c (idris_classes ist) of
607 [] -> return ()
607 [] -> return ()
608 _ -> -- type class, set as injective
608 _ -> -- type class, set as injective
@@ -615,7 +615,7 @@ elab ist info emode opts fn tm
615 probs <- get_probs
615 probs <- get_probs
616 traceWhen ulog (qshow probs) $ return ()
616 traceWhen ulog (qshow probs) $ return ()
617 _ -> return ()
617 _ -> return ()
619 setinjArg (P _ n _) = setinj n
619 setinjArg (P _ n _) = setinj n
620 setinjArg _ = return ()
620 setinjArg _ = return ()
@@ -634,7 +634,7 @@ elab ist info emode opts fn tm
635 elab' ina Placeholder = do (h : hs) <- get_holes
635 elab' ina Placeholder = do (h : hs) <- get_holes
636 movelast h
636 movelast h
637− elab' ina (PMetavar n) =
637+ elab' ina (PMetavar n) =
638 do ptm <- get_term
638 do ptm <- get_term
639 -- When building the metavar application, leave out the unique
639 -- When building the metavar application, leave out the unique
640 -- names which have been used elsewhere in the term, since we
640 -- names which have been used elsewhere in the term, since we
@@ -699,21 +699,6 @@ elab ist info emode opts fn tm
699 args <- get_env
699 args <- get_env
700 envU <- mapM (getKind args) args
700 envU <- mapM (getKind args) args
701 let namesUsedInRHS = nub $ scvn : concatMap (\(_,rhs) -> allNamesIn rhs) opts
701 let namesUsedInRHS = nub $ scvn : concatMap (\(_,rhs) -> allNamesIn rhs) opts
704− -- in the definition we build for the case, only pass through
705− -- names which are directly used, type class constraints, and
706− -- variables any of these depend on
707− -- FIXME: This probably doesn't help us, but leaving it in
708− -- temporarily (but commented out). If this comment is still
709− -- here in master, please delete the code!
710−-- let directUse = filter (\n -> usedIn namesUsedInRHS n
711−-- || tcName (binderTy (snd n))) args
712−-- let args' = args -- chaseDeps args (map fst directUse) directUse
713−-- let argsDropped = map fst $
714−-- filter (\(n, _) -> case lookup n args' of
718 -- Drop the unique arguments used in the scrutinee (since it's
703 -- Drop the unique arguments used in the scrutinee (since it's
719 -- not valid to use them again anyway)
704 -- not valid to use them again anyway)
@@ -724,7 +709,7 @@ elab ist info emode opts fn tm
724 let cname' = mkN cname
709 let cname' = mkN cname
725-- elab' ina (PMetavar cname')
710-- elab' ina (PMetavar cname')
726 attack; defer argsDropped cname'; solve
711 attack; defer argsDropped cname'; solve
728 -- if the scrutinee is one of the 'args' in env, we should
713 -- if the scrutinee is one of the 'args' in env, we should
729 -- inspect it directly, rather than adding it as a new argument
714 -- inspect it directly, rather than adding it as a new argument
730 let newdef = PClauses fc [] cname'
715 let newdef = PClauses fc [] cname'
@@ -748,10 +733,10 @@ elab ist info emode opts fn tm
748 Just u -> u
733 Just u -> u
749 _ -> False
734 _ -> False
751− getKind env (n, _)
736+ getKind env (n, _)
752 = case lookup n env of
737 = case lookup n env of
753 Nothing -> return (n, False) -- can't happen, actually...
738 Nothing -> return (n, False) -- can't happen, actually...
754− Just b ->
739+ Just b ->
755 do ty <- get_type (forget (binderTy b))
740 do ty <- get_type (forget (binderTy b))
756 case ty of
741 case ty of
757 UType UniqueType -> return (n, True)
742 UType UniqueType -> return (n, True)
@@ -764,8 +749,8 @@ elab ist info emode opts fn tm
764 _ -> False
749 _ -> False
765 tcName _ = False
750 tcName _ = False
767− usedIn ns (n, b)
752+ usedIn ns (n, b)
768− = n `elem` ns
753+ = n `elem` ns
769 || any (\x -> x `elem` ns) (allTTNames (binderTy b))
754 || any (\x -> x `elem` ns) (allTTNames (binderTy b))
771 -- FIXME: This probably doesn't help us here, but leaving
756 -- FIXME: This probably doesn't help us here, but leaving
@@ -791,7 +776,7 @@ elab ist info emode opts fn tm
791 = do -- First extract the unquoted subterms, replacing them with fresh
776 = do -- First extract the unquoted subterms, replacing them with fresh
792 -- names in the quasiquoted term. Claim their reflections to be
777 -- names in the quasiquoted term. Claim their reflections to be
793 -- of type TT.
778 -- of type TT.
794− (t, unq) <- extractUnquotes t
779+ (t, unq) <- extractUnquotes 0 t
795 let unquoteNames = map fst unq
780 let unquoteNames = map fst unq
796 mapM_ (flip claim (Var tt)) unquoteNames
781 mapM_ (flip claim (Var tt)) unquoteNames
@@ -872,7 +857,7 @@ elab ist info emode opts fn tm
872 isScr (PRef _ n) (n', b) = (n', (n == n', b))
857 isScr (PRef _ n) (n', b) = (n', (n == n', b))
873 isScr _ (n', b) = (n', (False, b))
858 isScr _ (n', b) = (n', (False, b))
875− caseBlock :: FC -> Name ->
860+ caseBlock :: FC -> Name ->
876 [(Name, (Bool, Binder Term))] -> [(PTerm, PTerm)] -> [PClause]
861 [(Name, (Bool, Binder Term))] -> [(PTerm, PTerm)] -> [PClause]
877 caseBlock fc n env opts
862 caseBlock fc n env opts
878 = let args' = findScr env
863 = let args' = findScr env
@@ -882,12 +867,12 @@ elab ist info emode opts fn tm
882 where -- Find the variable we want as the scrutinee and mark it as
867 where -- Find the variable we want as the scrutinee and mark it as
883 -- 'True'. If the scrutinee is in the environment, match on that
868 -- 'True'. If the scrutinee is in the environment, match on that
884 -- otherwise match on the new argument we're adding.
869 -- otherwise match on the new argument we're adding.
885− findScr ((n, (True, t)) : xs)
870+ findScr ((n, (True, t)) : xs)
886 = (n, (True, t)) : scrName n xs
871 = (n, (True, t)) : scrName n xs
887− findScr [(n, (_, t))] = [(n, (True, t))]
872+ findScr [(n, (_, t))] = [(n, (True, t))]
888 findScr (x : xs) = x : findScr xs
873 findScr (x : xs) = x : findScr xs
889 -- [] can't happen since scrutinee is in the environment!
874 -- [] can't happen since scrutinee is in the environment!
891 -- To make sure top level pattern name remains in scope, put
876 -- To make sure top level pattern name remains in scope, put
892 -- it at the end of the environment
877 -- it at the end of the environment
893 scrName n [] = []
878 scrName n [] = []
@@ -931,7 +916,7 @@ elab ist info emode opts fn tm
931 _ -> return t
916 _ -> return t
933 mkDelay env (PAlternative b xs) = PAlternative b (map (mkDelay env) xs)
918 mkDelay env (PAlternative b xs) = PAlternative b (map (mkDelay env) xs)
934− mkDelay env t
919+ mkDelay env t
935 = let fc = fileFC "Delay" in
920 = let fc = fileFC "Delay" in
936 addImplBound ist (map fst env) (PApp fc (PRef fc (sUN "Delay"))
921 addImplBound ist (map fst env) (PApp fc (PRef fc (sUN "Delay"))
937 [pexp t])
922 [pexp t])
@@ -998,10 +983,10 @@ elab ist info emode opts fn tm
998 failed' <- -- trace (show (n, t, hs, tm)) $
983 failed' <- -- trace (show (n, t, hs, tm)) $
999 -- traceWhen (not (null cs)) (show ty ++ "\n" ++ showImp True t) $
984 -- traceWhen (not (null cs)) (show ty ++ "\n" ++ showImp True t) $
1000 case holeName `elem` hs of
985 case holeName `elem` hs of
1001− True -> do focus holeName;
986+ True -> do focus holeName;
1002 g <- goal
987 g <- goal
1003 ulog <- getUnifyLog
988 ulog <- getUnifyLog
1004− traceWhen ulog ("Elaborating argument " ++ show (argName, holeName, g)) $
989+ traceWhen ulog ("Elaborating argument " ++ show (argName, holeName, g)) $
1005 elab ina t; return failed
990 elab ina t; return failed
1006 False -> return failed
991 False -> return failed
1007 done_elaborating_arg f argName
992 done_elaborating_arg f argName
@@ -1057,7 +1042,7 @@ pruneByType env t c as
1057 getName (PRef _ n) = Just n
1042 getName (PRef _ n) = Just n
1058 getName (PApp _ f _) = getName f
1043 getName (PApp _ f _) = getName f
1059 getName _ = Nothing
1044 getName _ = Nothing
1061pruneByType env (P _ n _) c as
1046pruneByType env (P _ n _) c as
1062-- if the goal type is polymorphic, keep e
1047-- if the goal type is polymorphic, keep e
1063 | [] <- lookupTy n c = as
1048 | [] <- lookupTy n c = as
@@ -1098,11 +1083,11 @@ trivial' ist
1098 = trivial (elab ist toplevel ERHS [] (sMN 0 "tac")) ist
1083 = trivial (elab ist toplevel ERHS [] (sMN 0 "tac")) ist
1099proofSearch' ist rec depth prv top n hints
1084proofSearch' ist rec depth prv top n hints
1100 = do unifyProblems
1085 = do unifyProblems
1101− proofSearch rec prv depth
1086+ proofSearch rec prv depth
1102 (elab ist toplevel ERHS [] (sMN 0 "tac")) top n hints ist
1087 (elab ist toplevel ERHS [] (sMN 0 "tac")) top n hints ist
1104resolveTC :: Bool -> Int -> Term -> Name -> IState -> ElabD ()
1089resolveTC :: Bool -> Int -> Term -> Name -> IState -> ElabD ()
1105−resolveTC = resTC' []
1090+resolveTC = resTC' []
1107resTC' tcs def 0 topg fn ist = fail $ "Can't resolve type class"
1092resTC' tcs def 0 topg fn ist = fail $ "Can't resolve type class"
1108resTC' tcs def 1 topg fn ist = try' (trivial' ist) (resolveTC def 0 topg fn ist) True
1093resTC' tcs def 1 topg fn ist = try' (trivial' ist) (resolveTC def 0 topg fn ist) True
@@ -1112,7 +1097,7 @@ resTC' tcs defaultOn depth topg fn ist
1112 ptm <- get_term
1097 ptm <- get_term
1113 ulog <- getUnifyLog
1098 ulog <- getUnifyLog
1114 hs <- get_holes
1099 hs <- get_holes
1115− traceWhen ulog ("Resolving class " ++ show g) $
1100+ traceWhen ulog ("Resolving class " ++ show g) $
1116 try' (trivial' ist)
1101 try' (trivial' ist)
1117 (do t <- goal
1102 (do t <- goal
1118 let (tc, ttypes) = unApply t
1103 let (tc, ttypes) = unApply t
@@ -1129,7 +1114,7 @@ resTC' tcs defaultOn depth topg fn ist
1130 -- HACK! Rather than giving a special name, better to have some kind
1115 -- HACK! Rather than giving a special name, better to have some kind
1131 -- of flag in ClassInfo structure
1116 -- of flag in ClassInfo structure
1132− chaser (UN nm)
1117+ chaser (UN nm)
1133 | ('@':'@':_) <- str nm = True -- old way
1118 | ('@':'@':_) <- str nm = True -- old way
1134 chaser (SN (ParentN _ _)) = True
1119 chaser (SN (ParentN _ _)) = True
1135 chaser (NS n _) = chaser n
1120 chaser (NS n _) = chaser n
@@ -1173,7 +1158,7 @@ resTC' tcs defaultOn depth topg fn ist
1173 args <- map snd <$> try' (apply (Var n) imps)
1158 args <- map snd <$> try' (apply (Var n) imps)
1174 (match_apply (Var n) imps) True
1159 (match_apply (Var n) imps) True
1175 ps' <- get_probs
1160 ps' <- get_probs
1176− when (length ps < length ps' || unrecoverable ps') $
1161+ when (length ps < length ps' || unrecoverable ps') $
1177 fail "Can't apply type class"
1162 fail "Can't apply type class"
1178-- traceWhen (all boundVar ttypes) ("Progress: " ++ show t ++ " with " ++ show n) $
1163-- traceWhen (all boundVar ttypes) ("Progress: " ++ show t ++ " with " ++ show n) $
1179 mapM_ (\ (_,n) -> do focus n
1164 mapM_ (\ (_,n) -> do focus n
@@ -1181,7 +1166,7 @@ resTC' tcs defaultOn depth topg fn ist
1181 let (tc', ttype) = unApply t'
1166 let (tc', ttype) = unApply t'
1182 let got = fst (unApply t)
1167 let got = fst (unApply t)
1183 let depth' = if tc' `elem` tcs
1168 let depth' = if tc' `elem` tcs
1184− then depth - 1 else depth
1169+ then depth - 1 else depth
1185 resTC' (got : tcs) defaultOn depth' topg fn ist)
1170 resTC' (got : tcs) defaultOn depth' topg fn ist)
1186 (filter (\ (x, y) -> not x) (zip (map fst imps) args))
1171 (filter (\ (x, y) -> not x) (zip (map fst imps) args))
1187 -- if there's any arguments left, we've failed to resolve
1172 -- if there's any arguments left, we've failed to resolve
@@ -1232,11 +1217,11 @@ case_ ind autoSolve ist fn tm = do
1232-- if a tactic adds unification problems, return an error
1217-- if a tactic adds unification problems, return an error
1234runTac :: Bool -> IState -> Name -> PTactic -> ElabD ()
1219runTac :: Bool -> IState -> Name -> PTactic -> ElabD ()
1235−runTac autoSolve ist fn tac
1220+runTac autoSolve ist fn tac
1236 = do env <- get_env
1221 = do env <- get_env
1237 g <- goal
1222 g <- goal
1238 let tac' = fmap (addImplBound ist (map fst env)) tac
1223 let tac' = fmap (addImplBound ist (map fst env)) tac
1239− if autoSolve
1224+ if autoSolve
1240 then runT tac'
1225 then runT tac'
1241 else no_errors (runT tac')
1226 else no_errors (runT tac')
1242 (Just (CantSolveGoal g (map (\(n, b) -> (n, binderTy b)) env)))
1227 (Just (CantSolveGoal g (map (\(n, b) -> (n, binderTy b)) env)))
@@ -1398,11 +1383,11 @@ runTac autoSolve ist fn tac
1398 letbind scriptvar scriptTy (Var script)
1383 letbind scriptvar scriptTy (Var script)
1399 focus script
1384 focus script
1400 ptm <- get_term
1385 ptm <- get_term
1401− elab ist toplevel ERHS [] (sMN 0 "tac")
1386+ elab ist toplevel ERHS [] (sMN 0 "tac")
1402 (PApp emptyFC tm [pexp (delabTy' ist [] tgoal True True)])
1387 (PApp emptyFC tm [pexp (delabTy' ist [] tgoal True True)])
1403 (script', _) <- get_type_val (Var scriptvar)
1388 (script', _) <- get_type_val (Var scriptvar)
1404 -- now that we have the script apply
1389 -- now that we have the script apply
1405− -- it to the reflected goal
1390+ -- it to the reflected goal
1406 restac <- getNameFrom (sMN 0 "restac")
1391 restac <- getNameFrom (sMN 0 "restac")
1407 claim restac tacticTy
1392 claim restac tacticTy
1408 focus restac
1393 focus restac
@@ -1482,7 +1467,7 @@ reify _ t = fail ("Unknown tactic " ++ show t)
1483reifyApp :: IState -> Name -> [Term] -> ElabD PTactic
1468reifyApp :: IState -> Name -> [Term] -> ElabD PTactic
1484reifyApp ist t [l, r] | t == reflm "Try" = liftM2 Try (reify ist l) (reify ist r)
1469reifyApp ist t [l, r] | t == reflm "Try" = liftM2 Try (reify ist l) (reify ist r)
1485−reifyApp _ t [Constant (I i)]
1470+reifyApp _ t [Constant (I i)]
1486 | t == reflm "Search" = return (ProofSearch True True i Nothing [])
1471 | t == reflm "Search" = return (ProofSearch True True i Nothing [])
1487reifyApp _ t [x]
1472reifyApp _ t [x]
1488 | t == reflm "Refine" = do n <- reifyTTName x
1473 | t == reflm "Refine" = do n <- reifyTTName x
@@ -2223,4 +2208,3 @@ envTupleType
2225solveAll = try (do solve; solveAll) (return ())
2210solveAll = try (do solve; solveAll) (return ())