X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FDsMeta.hs;h=902eeb8f3f59a73135f7110f206d4d18ca658531;hp=e95df4dbd5345d38996e42b1fd8e91caf5bc8252;hb=85f969a6585c06168645114d9524e7169dbc6e32;hpb=dfa43eb4dd7cd898b4a0f55f51d1eace71f22762 diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index e95df4d..902eeb8 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -714,20 +714,26 @@ repE (HsLet bs e) = do { (ss,ds) <- repBinds bs ; e2 <- addBinds ss (repLE e) ; z <- repLetE ds e2 ; wrapGenSyns ss z } + -- FIXME: I haven't got the types here right yet -repE (HsDo DoExpr sts body _) +repE e@(HsDo ctxt sts body _) + | case ctxt of { DoExpr -> True; GhciStmt -> True; _ -> False } = do { (ss,zs) <- repLSts sts; body' <- addBinds ss $ repLE body; ret <- repNoBindSt body'; - e <- repDoE (nonEmptyCoreList (zs ++ [ret])); - wrapGenSyns ss e } -repE (HsDo ListComp sts body _) + e' <- repDoE (nonEmptyCoreList (zs ++ [ret])); + wrapGenSyns ss e' } + + | ListComp <- ctxt = do { (ss,zs) <- repLSts sts; body' <- addBinds ss $ repLE body; ret <- repNoBindSt body'; - e <- repComp (nonEmptyCoreList (zs ++ [ret])); - wrapGenSyns ss e } -repE e@(HsDo _ _ _ _) = notHandled "mdo and [: :]" (ppr e) + e' <- repComp (nonEmptyCoreList (zs ++ [ret])); + wrapGenSyns ss e' } + + | otherwise + = notHandled "mdo and [: :]" (ppr e) + repE (ExplicitList _ es) = do { xs <- repLEs es; repListExp xs } repE e@(ExplicitPArr _ _) = notHandled "Parallel arrays" (ppr e) repE e@(ExplicitTuple es boxed)