@@ -26,8 +26,9 @@ import Data.Maybe
2626import Debug.Trace
2727
2828
29−recheckC ctxt fc env t
29+recheckC fc env t
3030 = do -- t' <- applyOpts (forget t) (doesn't work, or speed things up...)
31+ ctxt <- getContext
3132 (tm, ty, cs) <- tclift $ case recheck ctxt env (forget t) t of
3233 Error e -> tfail (At fc e)
3334 OK x -> return x
@@ -35,7 +36,7 @@ recheckC ctxt fc env t
3536 return (tm, ty)
3637
3738checkDef fc ns = do ctxt <- getContext
38− mapM (\(n, t) -> do (t', _) <- recheckC ctxt fc [] t
39+ mapM (\(n, t) -> do (t', _) <- recheckC fc [] t
3940 return (n, t')) ns
4041
4142elabType :: ElabInfo -> SyntaxInfo -> FC -> FnOpts -> Name -> PTerm -> Idris ()
@@ -54,7 +55,7 @@ elabType info syn fc opts n ty' = {- let ty' = piBind (params info) ty_in
5455 addDeferred ds
5556 mapM_ (elabCaseBlock info) is
5657 ctxt <- getContext
57− (cty, _) <- recheckC ctxt fc [] tyT
58+ (cty, _) <- recheckC fc [] tyT
5859 addStatics n cty ty'
5960 logLvl 2 $ "---> " ++ show cty
6061 let nty = normalise ctxt [] cty
@@ -77,7 +78,7 @@ elabData info syn fc (PDatadecl n t_in dcons)
7778 def' <- checkDef fc defer
7879 addDeferred def'
7980 mapM_ (elabCaseBlock info) is
80− (cty, _) <- recheckC ctxt fc [] t'
81+ (cty, _) <- recheckC fc [] t'
8182 logLvl 2 $ "---> " ++ show cty
8283 updateContext (addTyDecl n cty) -- temporary, to check cons
8384 cons <- mapM (elabCon info syn n) dcons
@@ -205,7 +206,7 @@ elabCon info syn tn (n, t_in, fc)
205206 addDeferred def'
206207 mapM_ (elabCaseBlock info) is
207208 ctxt <- getContext
208− (cty, _) <- recheckC ctxt fc [] t'
209+ (cty, _) <- recheckC fc [] t'
209210 tyIs cty
210211 logLvl 2 $ "---> " ++ show n ++ " : " ++ show cty
211212 addIBC (IBCDef n)
@@ -326,7 +327,7 @@ elabVal info aspat tm_in
326327 logLvl 3 ("Value: " ++ show tm')
327328 let vtm = getInferTerm tm'
328329 logLvl 2 (show vtm)
329− recheckC ctxt (FC "(input)" 0) [] vtm
330+ recheckC (FC "(input)" 0) [] vtm
330331
331332-- checks if the clause is a possible left hand side. Returns the term if
332333-- possible, otherwise Nothing.
@@ -365,7 +366,7 @@ elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
365366 let lhs_tm = orderPats (getInferTerm lhs')
366367 let lhs_ty = getInferType lhs'
367368 logLvl 3 (show lhs_tm)
368− (clhs, clhsty) <- recheckC ctxt fc [] lhs_tm
369+ (clhs, clhsty) <- recheckC fc [] lhs_tm
369370 logLvl 5 ("Checked " ++ show clhs)
370371 -- Elaborate where block
371372 ist <- getIState
@@ -398,7 +399,7 @@ elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
398399 mapM_ (elabCaseBlock info) is
399400 ctxt <- getContext
400401 logLvl 5 $ "Rechecking"
401− (crhs, crhsty) <- recheckC ctxt fc [] rhs'
402+ (crhs, crhsty) <- recheckC fc [] rhs'
402403 i <- get
403404 checkInferred fc (delab' i crhs True) rhs
404405 return $ Just (clhs, crhs)
@@ -430,7 +431,7 @@ elabClause info tcgen (PWith fc fname lhs_in withs wval_in withblock)
430431 let lhs_ty = getInferType lhs'
431432 let ret_ty = getRetTy lhs_ty
432433 logLvl 3 (show lhs_tm)
433− (clhs, clhsty) <- recheckC ctxt fc [] lhs_tm
434+ (clhs, clhsty) <- recheckC fc [] lhs_tm
434435 logLvl 5 ("Checked " ++ show clhs)
435436 let bargs = getPBtys lhs_tm
436437 let wval = addImplBound i (map fst bargs) wval_in
@@ -448,7 +449,7 @@ elabClause info tcgen (PWith fc fname lhs_in withs wval_in withblock)
448449 def' <- checkDef fc defer
449450 addDeferred def'
450451 mapM_ (elabCaseBlock info) is
451− (cwval, cwvalty) <- recheckC ctxt fc [] (getInferTerm wval')
452+ (cwval, cwvalty) <- recheckC fc [] (getInferTerm wval')
452453 logLvl 3 ("With type " ++ show cwvalty ++ "\nRet type " ++ show ret_ty)
453454 windex <- getName
454455 -- build a type declaration for the new function:
@@ -485,7 +486,7 @@ elabClause info tcgen (PWith fc fname lhs_in withs wval_in withblock)
485486 def' <- checkDef fc defer
486487 addDeferred def'
487488 mapM_ (elabCaseBlock info) is
488− (crhs, crhsty) <- recheckC ctxt fc [] rhs'
489+ (crhs, crhsty) <- recheckC fc [] rhs'
489490 return $ Just (clhs, crhs)
490491 where
491492 getImps (Bind n (Pi _) t) = pexp Placeholder : getImps t