Skip to content
Snippets Groups Projects
Commit 9359dbcc authored by Ben Gamari's avatar Ben Gamari
Browse files

TcRnMonad: Backport pushLevelAndCaptureConstraints

parent d3e069a3
No related branches found
No related tags found
No related merge requests found
...@@ -1170,6 +1170,17 @@ captureTcLevel thing_inside ...@@ -1170,6 +1170,17 @@ captureTcLevel thing_inside
thing_inside thing_inside
; return (res, tclvl') } ; return (res, tclvl') }
pushLevelAndCaptureConstraints :: TcM a -> TcM (a, TcLevel, WantedConstraints)
pushLevelAndCaptureConstraints thing_inside
= do { env <- getLclEnv
; lie_var <- newTcRef emptyWC ;
; let tclvl' = pushTcLevel (tcl_tclvl env)
; res <- setLclEnv (env { tcl_tclvl = tclvl'
, tcl_lie = lie_var })
thing_inside
; lie <- readTcRef lie_var
; return (res, tclvl', lie) }
pushTcLevelM :: TcM a -> TcM a pushTcLevelM :: TcM a -> TcM a
pushTcLevelM thing_inside pushTcLevelM thing_inside
= do { env <- getLclEnv = do { env <- getLclEnv
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment