composewell / streamly

High performance, concurrent functional programming abstractions
https://streamly.composewell.com
Other
859 stars 65 forks source link

0.10.1 fails to build with +use-unliftio #2739

Closed hasufell closed 5 months ago

hasufell commented 5 months ago
  1. cabal unpack streamly-0.10.1
  2. cd streamly-0.10.1
  3. cabal build -w ghc-9.6.5 f+use-unliftio
[ 3 of 72] Compiling Streamly.Internal.Control.Concurrent ( src/Streamly/Internal/Control/Concurrent.hs, dist-newstyle/build/x86_64-linux/ghc-9.6.5/streamly-0.10.1/build/Streamly/Internal/Control/Concurrent.o, dist-newstyle/build/x86_64-linux/ghc-9.6.5/streamly-0.10.1/build/Streamly/Internal/Control/Concurrent.dyn_o ) [Flags changed]

src/Streamly/Internal/Control/Concurrent.hs:60:47: error: [GHC-25897]
    • Couldn't match type ‘b’
                     with ‘monad-control-1.0.3.1:Control.Monad.Trans.Control.StM m b’
      Expected: m b
                -> IO (monad-control-1.0.3.1:Control.Monad.Trans.Control.StM m b)
        Actual: m b -> IO b
      ‘b’ is a rigid type variable bound by
        a type expected by the context:
          forall b.
          m b
          -> IO (monad-control-1.0.3.1:Control.Monad.Trans.Control.StM m b)
        at src/Streamly/Internal/Control/Concurrent.hs:60:47-49
    • In the first argument of ‘RunInIO’, namely ‘run’
      In the expression: RunInIO run
      In the first argument of ‘fmap’, namely
        ‘(\ (UnliftIO run) -> RunInIO run)’
    • Relevant bindings include
        run :: forall a. m a -> IO a
          (bound at src/Streamly/Internal/Control/Concurrent.hs:60:31)
        askRunInIO :: m (RunInIO m)
          (bound at src/Streamly/Internal/Control/Concurrent.hs:60:1)
   |
60 | askRunInIO = fmap (\(UnliftIO run) -> RunInIO run) askUnliftIO
   |                                               ^^^
harendra-kumar commented 5 months ago

use-unliftio flag is an experimental, developer-only flag to try out unliftio, it is not guaranteed to be working and is not supposed to be used by regular users of the library.

hasufell commented 5 months ago

Thanks, that means I'll have to drop streamly.

harendra-kumar commented 5 months ago

You can use it without the unliftio flag. Please keep in mind that transformers library made a breaking change in version 0.6. And GHC-9.6 works only with transformers-0.6. As long as you are using transformers >= 0.6 you should be able to use GHC-9.6 . It is not a requirement by streamly but by GHC.

harendra-kumar commented 5 months ago

If anything needs to change in streamly, we will be happy to help. Unfortunately, the transformers-0.6 breaking change is beyond our control.