maoe / lifted-async

Run lifted IO operations asynchronously and wait for their results
http://hackage.haskell.org/package/lifted-async
BSD 3-Clause "New" or "Revised" License
29 stars 13 forks source link

Fix typechecking errors with GHC head (8.11) #31

Closed facundominguez closed 4 years ago

facundominguez commented 4 years ago

Without this, GHC says:

 /home/centos/lifted-async/src/Control/Concurrent/Async/Lifted.hs:451:41: error:
     • Couldn't match type ‘b0’ with ‘forall a. m a -> IO (StM m a)’
       Expected: RunInBase m IO -> IO a
         Actual: b0 -> IO a
       Cannot instantiate unification variable ‘b0’
       with a type involving polytypes: forall a. m a -> IO (StM m a)
     • In the second argument of ‘($)’, namely
         ‘const (forever $ threadDelay maxBound)’
       In the second argument of ‘($)’, namely
         ‘liftBaseWith $ const (forever $ threadDelay maxBound)’
       In the expression:
         Concurrently
           $ liftBaseWith $ const (forever $ threadDelay maxBound)
     • Relevant bindings include
         empty :: Concurrently m a
           (bound at src/Control/Concurrent/Async/Lifted.hs:451:3)
     |             
 451 |   empty = Concurrently $ liftBaseWith $ const (forever $ threadDelay m
axBound)
     | 
maoe commented 4 years ago

LGTM, thanks! Do you know why GHC HEAD started complaining about it?

facundominguez commented 4 years ago

I don't know, yet. But it is something to look at from closer. It could very well be a bug that is fixed before release.

maoe commented 4 years ago

Released on Hackage as https://hackage.haskell.org/package/lifted-async-0.10.1.1. Thanks again.

facundominguez commented 4 years ago

Oh, I think these errors are definitely to stay in ghc-8.12: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/rank_polymorphism.html#simple-subsumption