ekmett / machines

Networks of composable stream transducers
Other
339 stars 46 forks source link

Add some additional instances for PlanT #52

Closed iand675 closed 9 years ago

iand675 commented 9 years ago

Would it be possible to add instances for the classes provided by the mmorph package? Also, having instances for the exceptions package classes, and monad-control for PlanTwould be great! These classes would make complex data processing scenarios a lot easier.

iand675 commented 9 years ago

So, I took a few stabs at implementing MFunctor & MMonad, and I'm getting the feeling that it can't be done? PlanT's CPS style doesn't seem to lend itself to converting ms to ns, but I don't have a well-founded rationale for why. It's really a shame though, because it seems to preclude using resourcet or the like to have prompt resource finalization.

ekmett commented 9 years ago

You're going to run into problems with this.

You can't have m occur in both positive and negative position and still have an MFunctor.

That is precisely what is happening here. The issue is the same one that precludes ContT r from having an MFunctor instance.

ekmett commented 9 years ago

Closing this out as it can't work.