@@ -1249,8 +1249,8 @@ elabPE info fc caller r =
12491249
12501250-- Elaborate a value, returning any new bindings created (this will only
12511251-- happen if elaborating as a pattern clause)
1252−elabValBind :: ElabInfo -> Bool -> PTerm -> Idris (Term, Type, [(Name, Type)])
1253−elabValBind info aspat tm_in
1252+elabValBind :: ElabInfo -> Bool -> Bool -> PTerm -> Idris (Term, Type, [(Name, Type)])
1253+elabValBind info aspat norm tm_in
12541254 = do ctxt <- getContext
12551255 i <- getIState
12561256 let tm = addImpl i tm_in
@@ -1275,14 +1275,17 @@ elabValBind info aspat tm_in
12751275 logLvl 3 ("Value: " ++ show vtm)
12761276-- recheckC (fileFC "(input)") [] tm'
12771277-- logLvl 2 (show vtm)
1278− (vtm, vty) <- recheckC (fileFC "(input)") [] vtm
1278+ (vtm_in, vty) <- recheckC (fileFC "(input)") [] vtm
1279+
1280+ let vtm = if norm then normalise (tt_ctxt i) [] vtm_in
1281+ else vtm_in
12791282 let bargs = getPBtys vtm
12801283
12811284 return (vtm, vty, bargs)
12821285
12831286elabVal :: ElabInfo -> Bool -> PTerm -> Idris (Term, Type)
12841287elabVal info aspat tm_in
1285− = do (tm, ty, _) <- elabValBind info aspat tm_in
1288+ = do (tm, ty, _) <- elabValBind info aspat False tm_in
12861289 return (tm, ty)
12871290
12881291-- checks if the clause is a possible left hand side. Returns the term if