Haskell 如何解决建筑流融合问题

Haskell 如何解决建筑流融合问题,haskell,Haskell,我正试图将流融合库引入到我的项目中。我正在使用堆栈(LTS 5.16)。我将stream-fusion-0.1.2.5版本添加到项目的cabal文件中,并将其作为额外的依赖项添加到我的stack.yaml中 然而,当我尝试构建项目时,我现在得到了以下结果: stream-fusion-0.1.2.5: configure stream-fusion-0.1.2.5: build -- While building package stream-fusion-0.1.2.5 using:

我正试图将流融合库引入到我的项目中。我正在使用堆栈(LTS 5.16)。我将stream-fusion-0.1.2.5版本添加到项目的cabal文件中,并将其作为额外的依赖项添加到我的stack.yaml中

然而,当我尝试构建项目时,我现在得到了以下结果:

stream-fusion-0.1.2.5: configure
stream-fusion-0.1.2.5: build

--  While building package stream-fusion-0.1.2.5 using:
      /Users/me/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/me/Haskell/hqfl/.stack-work/logs/stream-fusion-0.1.2.5.log

    Configuring stream-fusion-0.1.2.5...
    Building stream-fusion-0.1.2.5...
    Preprocessing library stream-fusion-0.1.2.5...
    [1 of 3] Compiling Data.Stream      ( Data/Stream.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Data/Stream.o )

    /private/var/folders/q_/qbq9bct96jj8p_c9kqbhmt840000gn/T/stack6002/stream-fusion-0.1.2.5/Data/Stream.hs:591:5: Warning:
        Pattern match(es) are non-exhaustive
        In an equation for ‘next’:
            Patterns not matched: (_ :!: (Just (L _))) :!: S2
    [2 of 3] Compiling Data.List.Stream ( Data/List/Stream.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Data/List/Stream.o )

    /private/var/folders/q_/qbq9bct96jj8p_c9kqbhmt840000gn/T/stack6002/stream-fusion-0.1.2.5/Data/List/Stream.hs:235:1: Warning:
        The import of ‘seq, Int’ from module ‘Prelude’ is redundant

    /private/var/folders/q_/qbq9bct96jj8p_c9kqbhmt840000gn/T/stack6002/stream-fusion-0.1.2.5/Data/List/Stream.hs:1703:10: Warning: Tab character

    /private/var/folders/q_/qbq9bct96jj8p_c9kqbhmt840000gn/T/stack6002/stream-fusion-0.1.2.5/Data/List/Stream.hs:2496:1: Warning:
        Rule "genericSplitAt -> fusible" may never fire
          because ‘genericSplitAt’ might inline first
        Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‘genericSplitAt’

    /private/var/folders/q_/qbq9bct96jj8p_c9kqbhmt840000gn/T/stack6002/stream-fusion-0.1.2.5/Data/List/Stream.hs:2504:1: Warning:
        Rule "genericSplitAt -> splitAt/Int" may never fire
          because ‘genericSplitAt’ might inline first
        Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‘genericSplitAt’

    /private/var/folders/q_/qbq9bct96jj8p_c9kqbhmt840000gn/T/stack6002/stream-fusion-0.1.2.5/Data/List/Stream.hs:2516:1: Warning:
        Rule "genericReplicate -> replicate/Int" may never fire
          because ‘genericReplicate’ might inline first
        Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‘genericReplicate’
    [3 of 3] Compiling Control.Monad.Stream ( Control/Monad/Stream.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Control/Monad/Stream.o )

    /private/var/folders/q_/qbq9bct96jj8p_c9kqbhmt840000gn/T/stack6002/stream-fusion-0.1.2.5/Control/Monad/Stream.hs:136:10:
        Ambiguous occurrence ‘MonadPlus’
        It could refer to either ‘Control.Monad.Stream.MonadPlus’,
                                 defined at Control/Monad/Stream.hs:124:1
                              or ‘GHC.Base.MonadPlus’,
                                 imported from ‘GHC.Base’ at Control/Monad/Stream.hs:80:1-15

    /private/var/folders/q_/qbq9bct96jj8p_c9kqbhmt840000gn/T/stack6002/stream-fusion-0.1.2.5/Control/Monad/Stream.hs:140:10:
        Ambiguous occurrence ‘MonadPlus’
        It could refer to either ‘Control.Monad.Stream.MonadPlus’,
                                 defined at Control/Monad/Stream.hs:124:1
                              or ‘GHC.Base.MonadPlus’,
                                 imported from ‘GHC.Base’ at Control/Monad/Stream.hs:80:1-15

如何解决此处的歧义?

您需要在
Control.Monad.Stream
中更改以下导入(第80行)

-导入GHC.Base
+导入GHC.Base隐藏(MonadPlus

+ , (=我想知道这一点,将/test/Bench目录移动到/Bench,使其成为一个cabal Bench。这些是结果第一个数字是Data.List,第二个Data.List.Stream.GHC没有使用任何这些,我想它只是改进了自己的build/foldr机制。我把你的校正和cabal Bench放在这里git@gitlab.com:迈克尔1/stream-fusion.git的价值。
- import GHC.Base
+ import           GHC.Base hiding ( MonadPlus
+                                 , (=<<)
+                                 , ap
+                                 , join
+                                 , liftM
+                                 , liftM2
+                                 , liftM3
+                                 , liftM4
+                                 , liftM5
+                                 , mapM
+                                 , mplus
+                                 , mzero
+                                 , sequence
+                                 , when
+                                 )