-zonkStmts :: TyVarEnv Type
- -> [TcStmt s] -> NF_TcM s ([TypecheckedStmt], TcEnv s)
-
-zonkStmts te [] = tcGetEnv `thenNF_Tc` \ env ->
- returnNF_Tc ([], env)
-
-zonkStmts te [ReturnStmt expr]
- = zonkExpr te expr `thenNF_Tc` \ new_expr ->
- tcGetEnv `thenNF_Tc` \ env ->
- returnNF_Tc ([ReturnStmt new_expr], env)
-
-zonkStmts te (ExprStmt expr locn : stmts)
- = zonkExpr te expr `thenNF_Tc` \ new_expr ->
- zonkStmts te stmts `thenNF_Tc` \ (new_stmts, new_env) ->
- returnNF_Tc (ExprStmt new_expr locn : new_stmts, new_env)
-
-zonkStmts te (GuardStmt expr locn : stmts)
- = zonkExpr te expr `thenNF_Tc` \ new_expr ->
- zonkStmts te stmts `thenNF_Tc` \ (new_stmts, new_env) ->
- returnNF_Tc (GuardStmt new_expr locn : new_stmts, new_env)
-
-zonkStmts te (LetStmt binds : stmts)
- = zonkBinds te binds `thenNF_Tc` \ (new_binds, new_env) ->
+zonkStmts :: [TcStmt]
+ -> NF_TcM [TypecheckedStmt]
+
+zonkStmts [] = returnNF_Tc []
+
+zonkStmts (ParStmtOut bndrstmtss : stmts)
+ = mapNF_Tc (mapNF_Tc zonkId) bndrss `thenNF_Tc` \ new_bndrss ->
+ let new_binders = concat new_bndrss in
+ mapNF_Tc zonkStmts stmtss `thenNF_Tc` \ new_stmtss ->
+ tcExtendGlobalValEnv new_binders $
+ zonkStmts stmts `thenNF_Tc` \ new_stmts ->
+ returnNF_Tc (ParStmtOut (zip new_bndrss new_stmtss) : new_stmts)
+ where (bndrss, stmtss) = unzip bndrstmtss
+
+zonkStmts (ExprStmt expr locn : stmts)
+ = zonkExpr expr `thenNF_Tc` \ new_expr ->
+ zonkStmts stmts `thenNF_Tc` \ new_stmts ->
+ returnNF_Tc (ExprStmt new_expr locn : new_stmts)
+
+zonkStmts (LetStmt binds : stmts)
+ = zonkBinds binds `thenNF_Tc` \ (new_binds, new_env) ->