X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FDsExpr.lhs;h=8dfcd309caf41a8738142fa296096b92f5ccaf3b;hb=67c2b6a15ec56f45001e24dc910282385e0cc6bf;hp=f7b232cbd078c7b1644a627cb84d5c86ae1bda9f;hpb=14e8b22bfb8d6428c9a37314efd7a28ae40b9154;p=ghc-hetmet.git diff --git a/compiler/deSugar/DsExpr.lhs b/compiler/deSugar/DsExpr.lhs index f7b232c..8dfcd30 100644 --- a/compiler/deSugar/DsExpr.lhs +++ b/compiler/deSugar/DsExpr.lhs @@ -85,7 +85,9 @@ dsValBinds (ValBindsOut binds _) body = foldrDs ds_val_bind body binds ------------------------- dsIPBinds (IPBinds ip_binds dict_binds) body = do { prs <- dsLHsBinds dict_binds - ; let inner = foldr (\(x,r) e -> Let (NonRec x r) e) body prs + ; let inner = Let (Rec prs) body + -- The dict bindings may not be in + -- dependency order; hence Rec ; foldrDs ds_ip_bind inner ip_binds } where ds_ip_bind (L _ (IPBind n e)) body @@ -218,7 +220,7 @@ dsExpr (HsApp (L _ (HsApp realFun@(L _ (HsCoerce _ fun)) (L loc arg))) _) | HsVar funId <- fun , idName funId `elem` [breakpointJumpName, breakpointCondJumpName] , ids <- filter (isValidType . idType) (extractIds arg) - = do dsWarn (text "Extracted ids:" <+> ppr ids <+> ppr (map idType ids)) + = do warnDs (text "Extracted ids:" <+> ppr ids <+> ppr (map idType ids)) stablePtr <- ioToIOEnv $ newStablePtr ids -- Yes, I know... I'm gonna burn in hell. let Ptr addr# = castStablePtrToPtr stablePtr @@ -279,20 +281,10 @@ dsExpr (OpApp e1 op _ e2) dsLExpr e2 `thenDs` \ y_core -> returnDs (mkApps core_op [x_core, y_core]) -dsExpr (SectionL expr op) - = dsLExpr op `thenDs` \ core_op -> - -- for the type of y, we need the type of op's 2nd argument - let - (x_ty:y_ty:_, _) = splitFunTys (exprType core_op) - -- Must look through an implicit-parameter type; - -- newtype impossible; hence Type.splitFunTys - in - dsLExpr expr `thenDs` \ x_core -> - newSysLocalDs x_ty `thenDs` \ x_id -> - newSysLocalDs y_ty `thenDs` \ y_id -> - - returnDs (bindNonRec x_id x_core $ - Lam y_id (mkApps core_op [Var x_id, Var y_id])) +dsExpr (SectionL expr op) -- Desugar (e !) to ((!) e) + = dsLExpr op `thenDs` \ core_op -> + dsLExpr expr `thenDs` \ x_core -> + returnDs (App core_op x_core) -- dsLExpr (SectionR op expr) -- \ x -> op x expr dsExpr (SectionR op expr)