Commit 341a7664 authored by Edward Z. Yang's avatar Edward Z. Yang

Doc: checkCrossStageLifting, RnSplice/TcExpr is untyped/typed brackets (#10384)

Clarify that repeated checkCrossStageLifting in RnSplice/TcExpr
check untyped/typed brackets, respectively.
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 1a4374c1
......@@ -595,6 +595,9 @@ checkCrossStageLifting :: TopLevelFlag -> Name -> ThStage -> TcM ()
-- Now we must check whether there's a cross-stage lift to do
-- Examples \x -> [| x |]
-- [| map |]
--
-- This code is similar to checkCrossStageLifting in TcExpr, but
-- this is only run on *untyped* brackets.
checkCrossStageLifting top_lvl name (Brack _ (RnPendingUntyped ps_var))
| isTopLevel top_lvl
......
......@@ -1254,15 +1254,18 @@ checkThLocalId id
--------------------------------------
checkCrossStageLifting :: Id -> ThStage -> TcM ()
-- If we are inside brackets, and (use_lvl > bind_lvl)
-- If we are inside typed brackets, and (use_lvl > bind_lvl)
-- we must check whether there's a cross-stage lift to do
-- Examples \x -> [| x |]
-- [| map |]
-- Examples \x -> [|| x ||]
-- [|| map ||]
-- There is no error-checking to do, because the renamer did that
--
-- This is similar to checkCrossStageLifting in RnSplice, but
-- this code is applied to *typed* brackets.
checkCrossStageLifting id (Brack _ (TcPending ps_var lie_var))
= -- Nested identifiers, such as 'x' in
-- E.g. \x -> [| h x |]
-- E.g. \x -> [|| h x ||]
-- We must behave as if the reference to x was
-- h $(lift x)
-- We use 'x' itself as the splice proxy, used by
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment