@@ -245,7 +245,7 @@ elab :: IState
245245elab ist info emode opts fn tm
246246 = do let loglvl = opt_logLevel (idris_options ist)
247247 when (loglvl > 5) $ unifyLog True
248− whnf_compute_args -- expand type synonyms, etc
248+ compute -- expand type synonyms, etc
249249 let fc = maybe "(unknown)"
250250 elabE initElabCtxt (elabFC info) tm -- (in argument, guarded, in type, in qquote)
251251 est <- getAux
@@ -339,13 +339,13 @@ elab ist info emode opts fn tm
339339 pexp ct]))
340340
341341 forceErr orig env (CantUnify _ (t,_) (t',_) _ _ _)
342− | (P _ (UN ht) _, _) <- unApply (whnf (tt_ctxt ist) env t),
342+ | (P _ (UN ht) _, _) <- unApply (normalise (tt_ctxt ist) env t),
343343 ht == txt "Delayed" = notDelay orig
344344 forceErr orig env (CantUnify _ (t,_) (t',_) _ _ _)
345− | (P _ (UN ht) _, _) <- unApply (whnf (tt_ctxt ist) env t'),
345+ | (P _ (UN ht) _, _) <- unApply (normalise (tt_ctxt ist) env t'),
346346 ht == txt "Delayed" = notDelay orig
347347 forceErr orig env (InfiniteUnify _ t _)
348− | (P _ (UN ht) _, _) <- unApply (whnf (tt_ctxt ist) env t),
348+ | (P _ (UN ht) _, _) <- unApply (normalise (tt_ctxt ist) env t),
349349 ht == txt "Delayed" = notDelay orig
350350 forceErr orig env (Elaborating _ _ _ t) = forceErr orig env t
351351 forceErr orig env (ElaboratingArg _ _ _ t) = forceErr orig env t
@@ -397,7 +397,7 @@ elab ist info emode opts fn tm
397397 highlightSource fc' (AnnConst c)
398398 elab' ina fc (PQuote r) = do fill r; solve
399399 elab' ina _ (PTrue fc _) =
400− do whnf_compute
400+ do compute
401401 g <- goal
402402 case g of
403403 TType _ -> elab' ina (Just fc) (PRef fc [] unitTy)
@@ -431,7 +431,7 @@ elab ist info emode opts fn tm
431431 pexp l, pexp r]))
432432
433433 elab' ina _ (PPair fc hls _ l r)
434− = do whnf_compute
434+ = do compute
435435 g <- goal
436436 let (tc, _) = unApply g
437437 case g of
@@ -454,7 +454,7 @@ elab ist info emode opts fn tm
454454 IsType -> asType
455455 IsTerm -> asValue
456456 TypeOrTerm ->
457− do whnf_compute
457+ do compute
458458 g <- goal
459459 case g of
460460 TType _ -> asType
@@ -544,7 +544,7 @@ elab ist info emode opts fn tm
544544 (trySeq' deferr xs) True
545545 elab' ina fc (PAlternative ms TryImplicit (orig : alts)) = do
546546 env <- get_env
547− whnf_compute
547+ compute
548548 ty <- goal
549549 let doelab = elab' ina fc orig
550550 tryCatch doelab
@@ -576,7 +576,7 @@ elab ist info emode opts fn tm
576576 recoverableErr _ = True
577577
578578 pruneAlts (CantUnify _ (inc, _) (outc, _) _ _ _) alts env
579− = case unApply (whnf (tt_ctxt ist) env inc) of
579+ = case unApply (normalise (tt_ctxt ist) env inc) of
580580 (P (TCon _ _) n _, _) -> filter (hasArg n env) alts
581581 (Constant _, _) -> alts
582582 _ -> filter isLend alts -- special case hack for 'Borrowed'
@@ -668,7 +668,7 @@ elab ist info emode opts fn tm
668668 do fty <- get_type (Var n) -- check for implicits
669669 ctxt <- get_context
670670 env <- get_env
671− let a' = insertScopedImps fc (whnfArgs ctxt env fty) []
671+ let a' = insertScopedImps fc (normalise ctxt env fty) []
672672 if null a'
673673 then erun fc $
674674 do apply (Var n) []
@@ -863,7 +863,7 @@ elab ist info emode opts fn tm
863863 let dataCon = isDConName f ctxt
864864 annot <- findHighlight f
865865 mapM_ checkKnownImplicit args_in
866− let args = insertScopedImps fc (whnfArgs ctxt env fty) args_in
866+ let args = insertScopedImps fc (normalise ctxt env fty) args_in
867867 let unmatchableArgs = if pattern
868868 then getUnmatchable (tt_ctxt ist) f
869869 else []
@@ -925,7 +925,7 @@ elab ist info emode opts fn tm
925925 return []
926926 Just rguess -> do
927927 gty <- get_type rguess
928− let ty_n = whnf ctxt env gty
928+ let ty_n = normalise ctxt env gty
929929 return $ getReqImps ty_n
930930 else return []
931931 -- Now we find out how many implicits we needed at the
@@ -982,7 +982,7 @@ elab ist info emode opts fn tm
982982 case lookupBinder n env of
983983 Nothing -> return ()
984984 Just b ->
985− case unApply (whnf (tt_ctxt ist) env (binderTy b)) of
985+ case unApply (normalise (tt_ctxt ist) env (binderTy b)) of
986986 (P _ c _, args) ->
987987 case lookupCtxtExact c (idris_interfaces ist) of
988988 Nothing -> return ()
@@ -1713,7 +1713,7 @@ pruneByType imp env (P _ n _) goalty ist as
17131713 Just ty -> case unApply (getRetTy ty) of
17141714 (P _ ctyn _, _) | isTConName ctyn ctxt && not (ctyn == f)
17151715 -> False
1716− _ -> let ty' = whnf ctxt [] ty in
1716+ _ -> let ty' = normalise ctxt [] ty in
17171717-- trace ("Trying " ++ show f' ++ " : " ++ show (getRetTy ty') ++ " for " ++ show goalty
17181718-- ++ "\nMATCH: " ++ show (pat, matching (getRetTy ty') goalty)) $
17191719 case unApply (getRetTy ty') of