@@ -501,8 +501,8 @@ checkPiGoal n
504−simple_app :: Elab' aux () -> Elab' aux () -> Elab' aux ()
504+simple_app :: Elab' aux () -> Elab' aux () -> String -> Elab' aux ()
505−simple_app fun arg =
505+simple_app fun arg appstr =
506 do a <- unique_hole (MN 0 "argTy")
506 do a <- unique_hole (MN 0 "argTy")
507 b <- unique_hole (MN 0 "retTy")
507 b <- unique_hole (MN 0 "retTy")
508 f <- unique_hole (MN 0 "f")
508 f <- unique_hole (MN 0 "f")
@@ -514,24 +514,21 @@ simple_app fun arg =
514 start_unify s
514 start_unify s
515 claim s (Var a)
515 claim s (Var a)
516 prep_fill f [s]
516 prep_fill f [s]
517− -- try elaborating in both orders, since we might learn something useful
519−-- try (do focus s; arg
523 focus f; fun
517 focus f; fun
524 focus s; arg
518 focus s; arg
525 tm <- get_term
519 tm <- get_term
526 ps <- get_probs
520 ps <- get_probs
527 complete_fill
521 complete_fill
528 hs <- get_holes
522 hs <- get_holes
529− -- We don't need a and b in the hole queue any more since they were just for
524+ -- We don't need a and b in the hole queue any more since they were
530− -- checking f, so discard them if they are still there. If they haven't been solved,
525+ -- just for checking f, so discard them if they are still there.
531− -- regret will fail
526+ -- If they haven't been solved, regret will fail
532− when (a `elem` hs) $ do focus a; regret
527+ when (a `elem` hs) $ do focus a; regretWith (CantInferType appstr)
533− when (b `elem` hs) $ do focus b; regret
528+ when (b `elem` hs) $ do focus b; regretWith (CantInferType appstr)
534 end_unify
529 end_unify
530+ where regretWith err = try regret
536-- Abstract over an argument of unknown type, giving a name for the hole
533-- Abstract over an argument of unknown type, giving a name for the hole
537-- which we'll fill with the argument type too.
534-- which we'll fill with the argument type too.