Relaxed type signature for mergeSources #25

Closed
dmcclean opened this Issue Jul 20, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@dmcclean
Contributor

dmcclean commented Jul 20, 2014

The current type of (>=<) and mergeSources requires the Sources being merged to use a monad of the form ResourceT m for some m. For example:

(>=<) :: (MonadIO m, MonadBaseControl IO m) => Source (ResourceT m) a -> Source (ResourceT m) a -> ResourceT m (Source (ResourceT m) a)

If possible, it would be great if this signature could be relaxed to a type like this one:

(>=<) :: (MonadIO m, MonadBaseControl IO m, MonadResource m) => Source m a -> Source m a -> ResourceT m (Source m a)

There may be some reason why this can't work, in which case I apologize for raising the issue. It does seem that it was once this way until version 0.4, so perhaps it was discovered to be unworkable.

If it is unworkable, you are aware of a workaround, and have time to explain it briefly that would be awesome. Thanks for the great library.

@bfops

This comment has been minimized.

Show comment Hide comment
@bfops

bfops Jul 20, 2014

Collaborator

LGTM. I haven't looked at this with a super-pessimistic eye, but it's been on my mind for a few weeks now. As far as I can tell, if you can get it to typecheck, it should work fine. Thanks!

Collaborator

bfops commented Jul 20, 2014

LGTM. I haven't looked at this with a super-pessimistic eye, but it's been on my mind for a few weeks now. As far as I can tell, if you can get it to typecheck, it should work fine. Thanks!

@dmcclean

This comment has been minimized.

Show comment Hide comment
@dmcclean

dmcclean Jul 20, 2014

Contributor

Ignore the one with hash a2a49ca, I forgot to make a branch before I pushed that one.

I think it would probably make sense to perform a similar surgery to mergeConduits for consistency, but I'm a little bit baffled by where the changes belong to make it happen.

Contributor

dmcclean commented Jul 20, 2014

Ignore the one with hash a2a49ca, I forgot to make a branch before I pushed that one.

I think it would probably make sense to perform a similar surgery to mergeConduits for consistency, but I'm a little bit baffled by where the changes belong to make it happen.

cgaebel added a commit that referenced this issue Jul 21, 2014

Merge pull request #26 from dmcclean/generalize-mergesources
Generalized type of mergeSources and (>=<) per issue #25.

@cgaebel cgaebel closed this Jul 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment