Closed hvr closed 9 years ago
Thanks for reporting. I don't have GHC 7.10 at the moment. I'll set it up and fix the issue.
@maoe the problem is the line
instance Monad m => Monad (Concurrently b m) where
return = Concurrently . return
Concurrently a >>= f = Concurrently $ a >>= runConcurrently . f
changing that to
instance Monad m => Monad (Concurrently IO m) where
...
let's it compile, but I'm not sure if this is the proper fix
UPDATE: nevermind -- something's still wrong
Here's what I had to change to make it compile, but I'm not sure this is the proper way:
diff --git a/src/Control/Concurrent/Async/Lifted.hs b/src/Control/Concurrent/Async/Lifted.hs
index 00677a7..b3961ad 100644
--- a/src/Control/Concurrent/Async/Lifted.hs
+++ b/src/Control/Concurrent/Async/Lifted.hs
@@ -386,7 +386,7 @@ instance (b ~ IO, MonadBaseControl b m) => Alternative (Concurrently b m) where
Concurrently as <|> Concurrently bs =
Concurrently $ either id id <$> race as bs
-instance Monad m => Monad (Concurrently b m) where
+instance (b ~ IO, MonadBaseControl b m) => Monad (Concurrently b m) where
return = Concurrently . return
Concurrently a >>= f = Concurrently $ a >>= runConcurrently . f
diff --git a/src/Control/Concurrent/Async/Lifted/Safe.hs b/src/Control/Concurrent/Async/Lifted/Safe.hs
index ab366b6..21eb5bb 100644
--- a/src/Control/Concurrent/Async/Lifted/Safe.hs
+++ b/src/Control/Concurrent/Async/Lifted/Safe.hs
@@ -325,7 +325,7 @@ instance (base ~ IO, MonadBaseControl base m, Forall (Pure m)) =>
\\ (inst :: Forall (Pure m) :- Pure m a)
\\ (inst :: Forall (Pure m) :- Pure m b)
-instance (Monad m, Forall (Pure m)) => Monad (Concurrently base m) where
+instance (base ~ IO, MonadBaseControl base m, Forall (Pure m)) => Monad (Concurrently base m) where
return = Concurrently . return
Concurrently a >>= f = Concurrently $ a >>= runConcurrently . f
#endif
Ah I see. I think we have to add those constraints for 7.10 due to the AMP change. I'll fix and make a release shortly.
Fixed the issue and just released as v0.4.0.