@@ -417,8 +417,16 @@ elabVal info aspat tm_in
417417 i <- get
418418 let tm = addImpl i tm_in
419419 logLvl 10 (showImp True tm)
420− ((tm', defer, is), _) <- tclift $ elaborate ctxt (MN 0 "val") infP []
421− (build i info aspat (MN 0 "val") (infTerm tm))
420+ -- try:
421+ -- * ordinary elaboration
422+ -- * elaboration as a Set
423+ -- * elaboration as a function a -> b
424+
425+ ((tm', defer, is), _) <-
426+ tctry (elaborate ctxt (MN 0 "val") (Set (UVal 0)) []
427+ (build i info aspat (MN 0 "val") tm))
428+ (elaborate ctxt (MN 0 "val") infP []
429+ (build i info aspat (MN 0 "val") (infTerm tm)))
422430 logLvl 3 ("Value: " ++ show tm')
423431 let vtm = getInferTerm tm'
424432 logLvl 2 (show vtm)
@@ -533,8 +541,9 @@ elabClause info tcgen (_, PWith fc fname lhs_in withs wval_in withblock)
533541 i <- get
534542 let lhs = addImpl i lhs_in
535543 logLvl 5 ("LHS: " ++ showImp True lhs)
536− ((lhs', dlhs, []), _) <- tclift $ elaborate ctxt (MN 0 "patLHS") infP []
537− (erun fc (buildTC i info True tcgen fname (infTerm lhs)))
544+ ((lhs', dlhs, []), _) <-
545+ tclift $ elaborate ctxt (MN 0 "patLHS") infP []
546+ (erun fc (buildTC i info True tcgen fname (infTerm lhs)))
538547 let lhs_tm = orderPats (getInferTerm lhs')
539548 let lhs_ty = getInferType lhs'
540549 let ret_ty = getRetTy lhs_ty