Closed sergv closed 9 years ago
By 7.10 branch do you mean ghc-7.10.1-release
branch or something else? I think there's no issue with the release version of 7.10.1. I cannot reproduce the error locally or remotely on travis with 7.10.1.
Okay, it seems that GHC has somehow changed after 7.10.1. I just retried the GHC HEAD build and it failed with the same error. Do you know what exactly has changed in GHC? I'd like to understand what's going on before applying this workaround.
If I replace the dots and dollars with parens, it typechecks. Will investigate further later.
diff --git a/src/Control/Concurrent/Async/Lifted.hs b/src/Control/Concurrent/Async/Lifted.hs
index cc1505b..f9dacbe 100644
--- a/src/Control/Concurrent/Async/Lifted.hs
+++ b/src/Control/Concurrent/Async/Lifted.hs
@@ -381,7 +381,7 @@ instance MonadBaseControl IO m => Applicative (Concurrently m) where
Concurrently $ uncurry ($) <$> concurrently fs as
instance MonadBaseControl IO m => Alternative (Concurrently m) where
- empty = Concurrently . liftBaseWith . const $ forever (threadDelay maxBound)
+ empty = Concurrently (liftBaseWith (const (forever (threadDelay maxBound))))
Concurrently as <|> Concurrently bs =
Concurrently $ either id id <$> race as bs
diff --git a/src/Control/Concurrent/Async/Lifted/Safe.hs b/src/Control/Concurrent/Async/Lifted/Safe.hs
index c419d4d..cf4ef7d 100644
--- a/src/Control/Concurrent/Async/Lifted/Safe.hs
+++ b/src/Control/Concurrent/Async/Lifted/Safe.hs
@@ -360,7 +360,7 @@ instance (MonadBaseControl IO m, Forall (Pure m)) =>
instance (MonadBaseControl IO m, Forall (Pure m)) =>
Alternative (Concurrently m) where
- empty = Concurrently . liftBaseWith . const $ forever (threadDelay maxBound)
+ empty = Concurrently (liftBaseWith (const (forever (threadDelay maxBound))))
Concurrently (as :: m a) <|> Concurrently bs =
Concurrently (either id id <$> race as bs)
\\ (inst :: Forall (Pure m) :- Pure m a)
Possibly related issue: https://ghc.haskell.org/trac/ghc/ticket/10194
I suspect that impredicativity support was somehow changed. That's what they promise on the wiki anyway, so it's not totally unexpected. And for dollar there's ad-hoc typing rule to facilitate type inference of code like runST $ do ...
, so maybe there's some subtle interaction between these.
Anyway, thanks for confirming the bug, it puzzled me a bit why 7.10 on CI was working.
Fixed and released as v0.7.0.1. Thanks for reporting.
Under 7.10 the build was failing with the following error
For some unknown reason the previous build with 7.10 on CI (https://travis-ci.org/maoe/lifted-async/jobs/56357141) is working, but I've been getting this error with ghc build from 7.10 branch.