@@ -16,11 +16,12 @@ import Idris.Core.Evaluate
16-- indexed with 'finalise'
16-- indexed with 'finalise'
18convertsC :: Context -> Env -> Term -> Term -> StateT UCs TC ()
18convertsC :: Context -> Env -> Term -> Term -> StateT UCs TC ()
19−convertsC ctxt env x y
19+convertsC ctxt env x y =
20+ do let hs = map fst (filter isHole env)
20− = do c1 <- convEq ctxt x y
21+ c1 <- convEq ctxt hs x y
21 if c1 then return ()
22 if c1 then return ()
23− do c2 <- convEq ctxt (finalise (normalise ctxt env x))
24+ do c2 <- convEq ctxt hs (finalise (normalise ctxt env x))
24 (finalise (normalise ctxt env y))
25 (finalise (normalise ctxt env y))
25 if c2 then return ()
26 if c2 then return ()
26 else lift $ tfail (CantConvert
27 else lift $ tfail (CantConvert
@@ -29,15 +30,19 @@ convertsC ctxt env x y
30converts :: Context -> Env -> Term -> Term -> TC ()
31converts :: Context -> Env -> Term -> Term -> TC ()
31converts ctxt env x y
32converts ctxt env x y
33+ = let hs = map fst (filter isHole env) in
32− = case convEq' ctxt x y of
34+ case convEq' ctxt hs x y of
33 OK True -> return ()
35 OK True -> return ()
34− _ -> case convEq' ctxt (finalise (normalise ctxt env x))
36+ _ -> case convEq' ctxt hs (finalise (normalise ctxt env x))
35− (finalise (normalise ctxt env y)) of
37+ (finalise (normalise ctxt env y)) of
36 OK True -> return ()
38 OK True -> return ()
37 _ -> tfail (CantConvert
39 _ -> tfail (CantConvert
38 (finalise (normalise ctxt env x))
40 (finalise (normalise ctxt env x))
39 (finalise (normalise ctxt env y)) (errEnv env))
41 (finalise (normalise ctxt env y)) (errEnv env))
43+isHole (n, Hole _) = True
41errEnv = map (\(x, b) -> (x, binderTy b))
46errEnv = map (\(x, b) -> (x, binderTy b))
43isType :: Context -> Env -> Term -> TC ()
48isType :: Context -> Env -> Term -> TC ()