packages feed

fusion-plugin 0.2.7 → 0.2.8

raw patch · 4 files changed

+58/−36 lines, 4 filesdep ~basedep ~containersdep ~ghcPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, containers, ghc, time

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+## 0.2.8++* Support ghc-9.14, adapt to HPT rule creation API change+* ghc-9.10 and ghc-9.12 were supported via hackage revisions+ ## 0.2.7  * Support ghc-9.6 and ghc-9.8
fusion-plugin.cabal view
@@ -1,7 +1,7 @@ cabal-version:       2.2  name:                fusion-plugin-version:             0.2.7+version:             0.2.8 synopsis:            GHC plugin to make stream fusion more predictable. description:   This plugin provides the programmer with a way to annotate certain@@ -20,26 +20,28 @@ bug-reports:         https://github.com/composewell/fusion-plugin/issues license:             Apache-2.0 license-file:        LICENSE-tested-with:         GHC==8.6.5-                   , GHC==8.8.4-                   , GHC==8.10.7-                   , GHC==9.0.2-                   , GHC==9.2.8-                   , GHC==9.4.7-                   , GHC==9.6.3-                   , GHC==9.8.1+tested-with:+      GHC==8.10.7+    , GHC==9.0.2+    , GHC==9.2.8+    , GHC==9.4.7+    , GHC==9.6.3+    , GHC==9.8.4+    , GHC==9.10.3+    , GHC==9.12.4+    , GHC==9.14.1 author:              Pranay Sashank maintainer:          streamly@composewell.com copyright:           (c) 2019 Composewell Technologies category:            Development-extra-source-files:  CHANGELOG.md-                     NOTICE-                     README.md-                     design/README.md-                     design/join-constr-app.hs-                     design/rec-binder-example.core-                     design/rec-binder-example.hs-                     stack.yaml+extra-doc-files:+    CHANGELOG.md+    NOTICE+    README.md+    design/README.md+    design/join-constr-app.hs+    design/rec-binder-example.core+    design/rec-binder-example.hs  source-repository head     type: git@@ -47,13 +49,13 @@  library   exposed-modules:     Fusion.Plugin-  build-depends:       base         >= 4.0     && <  5.0-                     , containers   >= 0.5.6.2 && <  0.8+  build-depends:       base         >= 4.0     && <  5+                     , containers   >= 0.5.6.2 && <  0.9                      , directory    >= 1.2.2.0 && <  1.4-                     , filepath     >= 1.4     && <  1.5-                     , ghc          >= 7.10.3  && <  9.9+                     , filepath     >= 1.4     && <  1.6+                     , ghc          >= 7.10.3  && <  9.15                      , syb          >= 0.7     && <  0.8-                     , time         >= 1.5     && <  1.14+                     , time         >= 1.5     && <  1.16                      , transformers >= 0.4     && < 0.7                       , fusion-plugin-types >= 0.1 && < 0.2
src/Fusion/Plugin.hs view
@@ -32,6 +32,7 @@ -- (e.g. 10x) to the code.  {-# OPTIONS_GHC -fno-warn-orphans #-}+{-# OPTIONS_GHC -Wno-x-partial #-} {-# LANGUAGE CPP #-}  module Fusion.Plugin@@ -67,6 +68,13 @@ import GHC.Driver.Config.Core.Opt.Simplify (initSimplMode, initSimplifyOpts) #endif +#if MIN_VERSION_ghc(9,14,0)+import GHC.Unit.Env (ue_hpt)+import GHC.Unit.Home.ModInfo (HomeModInfo(..))+import GHC.Unit.Home.PackageTable (concatHpt)+import GHC.Unit.Module.ModDetails (ModDetails(..))+#endif+ #if MIN_VERSION_ghc(9,6,0) #elif MIN_VERSION_ghc(9,2,0) import Data.Char (isSpace)@@ -423,10 +431,10 @@     -- annotated with "Fuse" and traverse the Alt expressions to discover more     -- let bindings.     go parents True (Case _ _ _ alts) =-        let binders = alts >>= (\(ALT_CONSTR(_,_,expr1)) -> go parents False expr1)+        let result = alts >>= (\(ALT_CONSTR(_,_,expr1)) -> go parents False expr1)         in case needInlineCaseAlt dflags parents anns alts of-            Just x -> (parents, x) : binders-            Nothing -> binders+            Just x -> (parents, x) : result+            Nothing -> result      -- Only traverse the Alt expressions of the case to discover new let     -- bindings. Do not match for annotated constructors in the Alts.@@ -754,13 +762,18 @@  fusionReport :: String -> ReportMode -> ModGuts -> CoreM ModGuts fusionReport mesg reportMode guts = do-    putMsgS $ "fusion-plugin: " ++ mesg ++ "..."-    dflags <- getDynFlags-    anns <- FMAP_SND getAnnotations deserializeWithData guts-    when (anyUFM (any (== Fuse)) anns) $-        mapM_ (transformBind dflags anns) $ mg_binds guts-    return guts-  where+    case reportMode of+        ReportSilent -> return guts+        _ -> do+            putMsgS $ "fusion-plugin: " ++ mesg ++ "..."+            dflags <- getDynFlags+            anns <- FMAP_SND getAnnotations deserializeWithData guts+            when (anyUFM (any (== Fuse)) anns) $+                mapM_ (transformBind dflags anns) $ mg_binds guts+            return guts++    where+     transformBind :: DynFlags -> UNIQ_FM -> CoreBind -> CoreM ()     transformBind dflags anns bind@(NonRec b _) = do         let results = containsAnns dflags anns bind@@ -1076,7 +1089,12 @@     options <- liftIO $ parseOptions args     dflags <- getDynFlags     hscEnv <- getHscEnv-#if MIN_VERSION_ghc(9,6,0)+#if MIN_VERSION_ghc(9,14,0)+    let hpt = ue_hpt (hsc_unit_env hscEnv)+    home_pkg_rules <- liftIO $  concatHpt (md_rules . hm_details) hpt+    let hpt_rule_base = mkRuleBase home_pkg_rules+        simplify = fusionSimplify hpt_rule_base hscEnv dflags+#elif MIN_VERSION_ghc(9,6,0)     m <- getModule     let         home_pkg_rules =
− stack.yaml
@@ -1,3 +0,0 @@-resolver: lts-17.14-packages:-- '.'