diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-01-12 19:30:55 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-22 15:02:45 -0500 |
commit | 957b53760e50d072accc17c77948f18a10a4bb53 (patch) | |
tree | 5099bcc355fc9a5047e5dac697511259f688e155 /testsuite | |
parent | 887eb6ec23eed243604f71c025d280c0b854f4c4 (diff) | |
download | haskell-957b53760e50d072accc17c77948f18a10a4bb53.tar.gz |
Core: introduce Alt/AnnAlt/IfaceAlt datatypes
Alt, AnnAlt and IfaceAlt were using triples. This patch makes them use
dedicated types so that we can try to make some fields strict (for
example) in the future.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/callarity/unittest/CallArity1.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/plugins/HomePackagePlugin.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/callarity/unittest/CallArity1.hs b/testsuite/tests/callarity/unittest/CallArity1.hs index 7ac0303820..33b8b067ed 100644 --- a/testsuite/tests/callarity/unittest/CallArity1.hs +++ b/testsuite/tests/callarity/unittest/CallArity1.hs @@ -74,7 +74,7 @@ exprs = (mkLams [y] $ Var y) ) $ mkLams [z] $ Var d `mkVarApps` [x]) $ Case (go `mkLApps` [0, 0]) z intTy - [(DEFAULT, [], Var f `mkVarApps` [z,z])] + [Alt DEFAULT [] (Var f `mkVarApps` [z,z])] , ("go2 (in function call)",) $ mkRFun go [x] (mkLetNonRec d (mkACase (Var go `mkVarApps` [x]) @@ -216,7 +216,7 @@ allBoundIds (Let (Rec binds) body) = allBoundIds (App e1 e2) = allBoundIds e1 `unionVarSet` allBoundIds e2 allBoundIds (Case scrut _ _ alts) = allBoundIds scrut `unionVarSet` unionVarSets - [ allBoundIds e | (_, _ , e) <- alts ] + [ allBoundIds e | Alt _ _ e <- alts ] allBoundIds (Lam _ e) = allBoundIds e allBoundIds (Tick _ e) = allBoundIds e allBoundIds (Cast e _) = allBoundIds e diff --git a/testsuite/tests/plugins/HomePackagePlugin.hs b/testsuite/tests/plugins/HomePackagePlugin.hs index d2b11dd81a..9349e833b1 100644 --- a/testsuite/tests/plugins/HomePackagePlugin.hs +++ b/testsuite/tests/plugins/HomePackagePlugin.hs @@ -31,4 +31,4 @@ replaceInExpr (Case e b ty alts) = Case (replaceInExpr e) b ty (map replaceInAlt replaceInExpr (Type ty) = Type ty replaceInAlt :: CoreAlt -> CoreAlt -replaceInAlt (ac, bs, e) = (ac, bs, replaceInExpr e) +replaceInAlt (Alt ac bs e) = Alt ac bs (replaceInExpr e) diff --git a/testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs index 49a3a6cffa..caa41cef16 100644 --- a/testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs +++ b/testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs @@ -10,7 +10,7 @@ import qualified GHC.Utils.Error import Simple.DataStructures import Control.Monad -import Data.Monoid +import Data.Monoid hiding (Alt) import Data.Dynamic import qualified Language.Haskell.TH as TH @@ -83,4 +83,4 @@ changeExpr anns mb_replacement e = let go = changeExpr anns mb_replacement in ca _ -> return e changeAlt :: VarEnv [ReplaceWith] -> Maybe String -> CoreAlt -> CoreM CoreAlt -changeAlt anns mb_replacement (con, bs, e) = liftM (\e' -> (con, bs, e')) (changeExpr anns mb_replacement e) +changeAlt anns mb_replacement (Alt con bs e) = liftM (\e' -> Alt con bs e') (changeExpr anns mb_replacement e) |