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

Build fails with monad-control-1.0.0.0 #8

Closed k0ral closed 9 years ago

k0ral commented 9 years ago

In the last version of monad-control, data families StT and StM were turned into type families, which breaks lifted-async's build. Well, at least that's what I understood by looking at this link.

Here is an extract of the build errors:

src/Control/Concurrent/Async/Lifted.hs:183:11:
    Could not deduce (StM m a0 ~ StM m a)
    from the context (MonadBase IO m)
      bound by the type signature for
                 cancel :: MonadBase IO m => Async (StM m a) -> m ()
      at src/Control/Concurrent/Async/Lifted.hs:183:11-51
    NB: ‘StM’ is a type function, and may not be injective
    The type variable ‘a0’ is ambiguous
    Expected type: Async (StM m a) -> m ()
      Actual type: Async (StM m a0) -> m ()
    In the ambiguity check for:
      forall (m :: * -> *) a. MonadBase IO m => Async (StM m a) -> m ()
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the type signature for ‘cancel’:
    In the ambiguity check for:
      forall (m :: * -> *) a b.
      MonadBaseControl IO m =>
      Async (StM m a) -> Async (StM m b) -> m ()
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the type signature for ‘waitEither_’:
      waitEither_ :: MonadBaseControl IO m =>
                     Async (StM m a) -> Async (StM m b) -> m ()

src/Control/Concurrent/Async/Lifted.hs:283:9:
    Could not deduce (StM m a0 ~ StM m a)
    from the context (MonadBase IO m)
      bound by the type signature for
                 link :: MonadBase IO m => Async (StM m a) -> m ()
      at src/Control/Concurrent/Async/Lifted.hs:283:9-49
    NB: ‘StM’ is a type function, and may not be injective
    The type variable ‘a0’ is ambiguous
    Expected type: Async (StM m a) -> m ()
      Actual type: Async (StM m a0) -> m ()
    In the ambiguity check for:
      forall (m :: * -> *) a. MonadBase IO m => Async (StM m a) -> m ()
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the type signature for ‘link’:
      link :: MonadBase IO m => Async (StM m a) -> m ()
maoe commented 9 years ago

Thanks for reporting. A relevant discussion is going on at #7.

maoe commented 9 years ago

I just uploaded v0.3.0 which supports monad-control 1.0.*.

k0ral commented 9 years ago

Thank you !