@@ -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− compute -- expand type synonyms, etc
248+ whnf_compute_args -- 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
@@ -387,7 +387,7 @@ elab ist info emode opts fn tm
387387 highlightSource fc' (AnnConst c)
388388 elab' ina fc (PQuote r) = do fill r; solve
389389 elab' ina _ (PTrue fc _) =
390− do compute
390+ do whnf_compute
391391 g <- goal
392392 case g of
393393 TType _ -> elab' ina (Just fc) (PRef fc [] unitTy)
@@ -421,7 +421,7 @@ elab ist info emode opts fn tm
421421 pexp l, pexp r]))
422422
423423 elab' ina _ (PPair fc hls _ l r)
424− = do compute
424+ = do whnf_compute
425425 g <- goal
426426 let (tc, _) = unApply g
427427 case g of
@@ -444,7 +444,7 @@ elab ist info emode opts fn tm
444444 IsType -> asType
445445 IsTerm -> asValue
446446 TypeOrTerm ->
447− do compute
447+ do whnf_compute
448448 g <- goal
449449 case g of
450450 TType _ -> asType
@@ -502,7 +502,7 @@ elab ist info emode opts fn tm
502502 ty <- goal
503503 ctxt <- get_context
504504 env <- get_env
505− let ty' = unDelay ty
505+ let ty' = normalise ctxt env (unDelay ty)
506506 let (tc, _) = unApply ty'
507507 return $ pruneByType env tc ty' ist as
508508
@@ -534,7 +534,7 @@ elab ist info emode opts fn tm
534534 (trySeq' deferr xs) True
535535 elab' ina fc (PAlternative ms TryImplicit (orig : alts)) = do
536536 env <- get_env
537− compute
537+ whnf_compute
538538 ty <- goal
539539 let doelab = elab' ina fc orig
540540 tryCatch doelab
@@ -658,7 +658,7 @@ elab ist info emode opts fn tm
658658 do fty <- get_type (Var n) -- check for implicits
659659 ctxt <- get_context
660660 env <- get_env
661− let a' = insertScopedImps fc (normalise ctxt env fty) []
661+ let a' = insertScopedImps fc (whnfArgs ctxt env fty) []
662662 if null a'
663663 then erun fc $
664664 do apply (Var n) []