on master help sign in
Properly compute default lambda var names

intro Nothing was using the hole name instead of the name from the pi type.

commit0497655dcab20c178a328bcd897f19512d7c201c authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateWed 23 Sep 2015, 13:22 (11 years ago) parent30f55ce
1 file changed+6−6
src/Idris/Core/ProofState.hs+6−6
src/Idris/Core/ProofState.hs+6−6
@@ -620,19 +620,19 @@ introTy ty n ctxt env _ = fail "Can't introduce here."
620620
621621intro :: Maybe Name -> RunTactic
622622intro mn ctxt env (Bind x (Hole t) (P _ x' _)) | x == x' =
623− do let n = case mn of
624− Just name -> name
625− Nothing -> x
626− let t' = case t of
623+ do let t' = case t of
627624 x@(Bind y (Pi _ s _) _) -> x
628625 _ -> hnf ctxt env t
629626 case t' of
630627 Bind y (Pi _ s _) t ->
628+ let n = case mn of
629+ Just name -> name
630+ Nothing -> y
631631 -- It's important that this be subst and not updsubst,
632632 -- because we want to substitute even in portions of
633633 -- terms that we know do not contain holes.
634− let t' = subst y (P Bound n s) t in
635− return $ Bind n (Lam s) (Bind x (Hole t') (P Bound x t'))
634+ t' = subst y (P Bound n s) t
635+ in return $ Bind n (Lam s) (Bind x (Hole t') (P Bound x t'))
636636 _ -> lift $ tfail $ CantIntroduce t'
637637intro n ctxt env _ = fail "Can't introduce here."
638638