on master help sign in
Search subterm for goal first
commitd6057b5f922bf3b485766108cd6c7c361fe17d3f authorEdwin Brady <ecb10@st-andrews.ac.uk> dateSun 3 Aug 2014, 21:27 (12 years ago) parentbc3a9bf
1 file changed+5−3
src/Idris/Core/ProofTerm.hs+5−3
src/Idris/Core/ProofTerm.hs+5−3
@@ -168,9 +168,11 @@ updateSolved xs pt@(PT path env sub)
168168 (updateSolvedTerm xs sub)
169169
170170goal :: Hole -> ProofTerm -> TC Goal
171−goal h pt@(PT path env sub) = do let tm = rebuildTerm sub path
172− ginf <- g [] (rebuildTerm sub path)
173− return ginf where
171+goal h pt@(PT path env sub)
172+ | OK ginf <- g env sub = return ginf
173+ | otherwise = g [] (rebuildTerm sub path)
174+ where
175+ g :: Env -> Term -> TC Goal
174176 g env (Bind n b@(Guess _ _) sc)
175177 | same h n = return $ GD env b
176178 | otherwise