on master help sign in
Make buildable with ghcjs
992206eHarendra Kumar
src/Streamly/Internal/Data/Stream/StreamD/Type.hs+1−1
@@ -74,7 +74,7 @@ import Data.Functor.Identity (Identity(..))
74import GHC.Base (build)
74import GHC.Base (build)
75import GHC.Types (SPEC(..))
75import GHC.Types (SPEC(..))
76import Prelude hiding (map, mapM, foldr, take, concatMap)
76import Prelude hiding (map, mapM, foldr, take, concatMap)
77−import Fusion.Plugin.Types (Fuse(..))
77+import Streamly.Internal.Fusion (Fuse(..))
78
78
79import Streamly.Internal.Data.SVar (State(..), adaptState, defState)
79import Streamly.Internal.Data.SVar (State(..), adaptState, defState)
80import Streamly.Internal.Data.Fold.Types (Fold(..), Fold2(..))
80import 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
245
245
246 ghc-options: -O0
246 ghc-options: -O0
247 -fno-ignore-asserts
247 -fno-ignore-asserts
248− if flag(fusion-plugin)
248+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
249 ghc-options: -fplugin Fusion.Plugin
249 ghc-options: -fplugin Fusion.Plugin
250 build-depends:
250 build-depends:
251 fusion-plugin >= 0.1 && < 0.2
251 fusion-plugin >= 0.1 && < 0.2
@@ -253,7 +253,7 @@ common test-options
253-- Used by maxrate test, benchmarks and executables
253-- Used by maxrate test, benchmarks and executables
254common exe-options
254common exe-options
255 import: compile-options, optimization-options, threading-options
255 import: compile-options, optimization-options, threading-options
256− if flag(fusion-plugin)
256+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
257 ghc-options: -fplugin Fusion.Plugin
257 ghc-options: -fplugin Fusion.Plugin
258 build-depends:
258 build-depends:
259 fusion-plugin >= 0.1 && < 0.2
259 fusion-plugin >= 0.1 && < 0.2
@@ -263,7 +263,7 @@ common exe-options
263common bench-options
263common bench-options
264 import: compile-options, optimization-options
264 import: compile-options, optimization-options
265 ghc-options: -with-rtsopts "-T -M256M"
265 ghc-options: -with-rtsopts "-T -M256M"
266− if flag(fusion-plugin)
266+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
267 ghc-options: -fplugin Fusion.Plugin
267 ghc-options: -fplugin Fusion.Plugin
268 build-depends:
268 build-depends:
269 fusion-plugin >= 0.1 && < 0.2
269 fusion-plugin >= 0.1 && < 0.2
@@ -274,7 +274,7 @@ common bench-options-threaded
274 -- -threaded and -N2 is important because some GC and space leak issues
274 -- -threaded and -N2 is important because some GC and space leak issues
275 -- trigger only with these options.
275 -- trigger only with these options.
276 ghc-options: -threaded -with-rtsopts "-T -N2 -M256M"
276 ghc-options: -threaded -with-rtsopts "-T -N2 -M256M"
277− if flag(fusion-plugin)
277+ if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
278 ghc-options: -fplugin Fusion.Plugin
278 ghc-options: -fplugin Fusion.Plugin
279 build-depends:
279 build-depends:
280 fusion-plugin >= 0.1 && < 0.2
280 fusion-plugin >= 0.1 && < 0.2
@@ -371,6 +371,7 @@ library
371 , Streamly.Internal.Data.Unicode.Char
371 , Streamly.Internal.Data.Unicode.Char
372 , Streamly.Internal.Memory.Unicode.Array
372 , Streamly.Internal.Memory.Unicode.Array
373 , Streamly.Internal.Prelude
373 , Streamly.Internal.Prelude
374+ , Streamly.Internal.Fusion
374
375
375 -- Mutable data
376 -- Mutable data
376 , Streamly.Internal.Mutable.Prim.Var
377 , Streamly.Internal.Mutable.Prim.Var
@@ -407,7 +408,9 @@ library
407 , monad-control >= 1.0 && < 2
408 , monad-control >= 1.0 && < 2
408 , transformers-base >= 0.4 && < 0.5
409 , transformers-base >= 0.4 && < 0.5
409
410
411+ if !impl(ghcjs) && !impl(ghc < 8.6)
412+ build-depends:
410− , fusion-plugin >= 0.1 && < 0.2
413+ fusion-plugin >= 0.1 && < 0.2
411
414
412 if !impl(ghcjs)
415 if !impl(ghcjs)
413 build-depends:
416 build-depends: