@@ -1359,6 +1359,8 @@ runTac autoSolve ist fn tac
13591359 _ -> fail "Wrong goal type"
13601360 runT ProofState = do g <- goal
13611361 return ()
1362+ runT Skip = return ()
1363+ runT (TFail err) = lift . tfail $ ReflectionError [err] (Msg "")
13621364 runT x = fail $ "Not implemented " ++ show x
13631365
13641366 runReflected t = do t' <- reify ist t
@@ -1376,6 +1378,7 @@ reify _ (P _ n _) | n == reflm "Trivial" = return Trivial
13761378reify _ (P _ n _) | n == reflm "Instance" = return TCInstance
13771379reify _ (P _ n _) | n == reflm "Solve" = return Solve
13781380reify _ (P _ n _) | n == reflm "Compute" = return Compute
1381+reify _ (P _ n _) | n == reflm "Skip" = return Skip
13791382reify ist t@(App _ _)
13801383 | (P _ f _, args) <- unApply t = reifyApp ist f args
13811384reify _ t = fail ("Unknown tactic " ++ show t)
@@ -1416,6 +1419,15 @@ reifyApp ist t [n, tt', t']
14161419 tt'' <- reifyTT tt'
14171420 t'' <- reifyTT t'
14181421 return $ LetTacTy n' (delab ist tt'') (delab ist t'')
1422+reifyApp ist t [errs]
1423+ | t == reflm "Fail" = case unList errs of
1424+ Nothing -> fail "Failed to reify errors"
1425+ Just errs' ->
1426+ let parts = mapM reifyReportPart errs' in
1427+ case parts of
1428+ Left err -> fail $ "Couldn't reify \"Fail\" tactic - " ++ show err
1429+ Right errs'' ->
1430+ return $ TFail errs''
14191431reifyApp _ f args = fail ("Unknown tactic " ++ show (f, args)) -- shouldn't happen
14201432
14211433-- | Reify terms from their reflected representation
@@ -2042,10 +2054,10 @@ reflErrName n = sNS (sUN n) ["Errors", "Reflection", "Language"]
20422054-- representation. Not in Idris or ElabD monads because it should be usable
20432055-- from either.
20442056reifyReportPart :: Term -> Either Err ErrorReportPart
2045−reifyReportPart (App (P (DCon _ _) n _) (Constant (Str msg))) | n == reflErrName "TextPart" =
2057+reifyReportPart (App (P (DCon _ _) n _) (Constant (Str msg))) | n == reflm "TextPart" =
20462058 Right (TextPart msg)
20472059reifyReportPart (App (P (DCon _ _) n _) ttn)
2048− | n == reflErrName "NamePart" =
2060+ | n == reflm "NamePart" =
20492061 case runElab [] (reifyTTName ttn) (initElaborator NErased initContext Erased) of
20502062 Error e -> Left . InternalMsg $
20512063 "could not reify name term " ++
@@ -2053,7 +2065,7 @@ reifyReportPart (App (P (DCon _ _) n _) ttn)
20532065 " when reflecting an error:" ++ show e
20542066 OK (n', _)-> Right $ NamePart n'
20552067reifyReportPart (App (P (DCon _ _) n _) tm)
2056− | n == reflErrName "TermPart" =
2068+ | n == reflm "TermPart" =
20572069 case runElab [] (reifyTT tm) (initElaborator NErased initContext Erased) of
20582070 Error e -> Left . InternalMsg $
20592071 "could not reify reflected term " ++
@@ -2061,7 +2073,7 @@ reifyReportPart (App (P (DCon _ _) n _) tm)
20612073 " when reflecting an error:" ++ show e
20622074 OK (tm', _) -> Right $ TermPart tm'
20632075reifyReportPart (App (P (DCon _ _) n _) tm)
2064− | n == reflErrName "SubReport" =
2076+ | n == reflm "SubReport" =
20652077 case unList tm of
20662078 Just xs -> do subParts <- mapM reifyReportPart xs
20672079 Right (SubReport subParts)