on master help sign in
Make buildable with ghcjs

Supply the fusion annotation type where fusion-plugin is not available.

commit992206e3c49b76c5401784934b2cf211cef7aa2e authorHarendra Kumar <harendra.kumar@gmail.com> dateTue 11 Feb 2020, 23:59 (7 years ago) parent6e96d74
3 files changed+33−6
src/Streamly/Internal/Data/Stream/StreamD/Type.hs+1−1 src/Streamly/Internal/Fusion.hs+24 streamly.cabal+8−5
src/Streamly/Internal/Data/Stream/StreamD/Type.hs+1−1
@@ -74,7 +74,7 @@ import Data.Functor.Identity (Identity(..))
7474import GHC.Base (build)
7575import GHC.Types (SPEC(..))
7676import Prelude hiding (map, mapM, foldr, take, concatMap)
77−import Fusion.Plugin.Types (Fuse(..))
77+import Streamly.Internal.Fusion (Fuse(..))
7878
7979import Streamly.Internal.Data.SVar (State(..), adaptState, defState)
8080import Streamly.Internal.Data.Fold.Types (Fold(..), Fold2(..))
src/Streamly/Internal/Fusion.hsnew file+24
@@ -0,0 +1,24 @@
1+{-# LANGUAGE CPP #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+
4+-- |
5+-- Module : Streamly.Internal.Fusion
6+-- Copyright : (c) Composewell Technologies
7+--
8+-- License : BSD3
9+-- Maintainer : streamly@composewell.com
10+-- Stability : experimental
11+-- Portability : GHC
12+
13+module Streamly.Internal.Fusion
14+ (
15+ Fuse (..)
16+ )
17+where
18+
19+#if defined(__GHCJS__) || __GLASGOW_HASKELL__ < 806
20+import Data.Data (Data)
21+data Fuse = Fuse deriving (Data)
22+#else
23+import Fusion.Plugin.Types (Fuse(..))
24+#endif
streamly.cabal+8−5
@@ -245,7 +245,7 @@ common test-options
245245
246246 ghc-options: -O0
247247 -fno-ignore-asserts
248− if flag(fusion-plugin)
248+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
249249 ghc-options: -fplugin Fusion.Plugin
250250 build-depends:
251251 fusion-plugin >= 0.1 && < 0.2
@@ -253,7 +253,7 @@ common test-options
253253-- Used by maxrate test, benchmarks and executables
254254common exe-options
255255 import: compile-options, optimization-options, threading-options
256− if flag(fusion-plugin)
256+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
257257 ghc-options: -fplugin Fusion.Plugin
258258 build-depends:
259259 fusion-plugin >= 0.1 && < 0.2
@@ -263,7 +263,7 @@ common exe-options
263263common bench-options
264264 import: compile-options, optimization-options
265265 ghc-options: -with-rtsopts "-T -M256M"
266− if flag(fusion-plugin)
266+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
267267 ghc-options: -fplugin Fusion.Plugin
268268 build-depends:
269269 fusion-plugin >= 0.1 && < 0.2
@@ -274,7 +274,7 @@ common bench-options-threaded
274274 -- -threaded and -N2 is important because some GC and space leak issues
275275 -- trigger only with these options.
276276 ghc-options: -threaded -with-rtsopts "-T -N2 -M256M"
277− if flag(fusion-plugin)
277+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
278278 ghc-options: -fplugin Fusion.Plugin
279279 build-depends:
280280 fusion-plugin >= 0.1 && < 0.2
@@ -371,6 +371,7 @@ library
371371 , Streamly.Internal.Data.Unicode.Char
372372 , Streamly.Internal.Memory.Unicode.Array
373373 , Streamly.Internal.Prelude
374+ , Streamly.Internal.Fusion
374375
375376 -- Mutable data
376377 , Streamly.Internal.Mutable.Prim.Var
@@ -407,7 +408,9 @@ library
407408 , monad-control >= 1.0 && < 2
408409 , transformers-base >= 0.4 && < 0.5
409410
410− , fusion-plugin >= 0.1 && < 0.2
411+ if !impl(ghcjs) && !impl(ghc < 8.6)
412+ build-depends:
413+ fusion-plugin >= 0.1 && < 0.2
411414
412415 if !impl(ghcjs)
413416 build-depends: