-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interoperability with libraries using MonadBaseControl IO
#477
Comments
There's no comfortable solution, you'll have to lower to the final IO. Something like foo = withWeavingToFinal \ s lower ex -> do
let stdout = runConduit $ pOut .| CL.mapM_ (\ x -> lower (stdoutHandler x <$ s))
stderr = runConduit $ pErr .| CL.mapM_ (\ x -> lower (stderrHandler x <$ s))
exit <- runConcurrently $
Concurrently stdout *>
Concurrently stderr *>
Concurrently (waitForStreamingProcess cph)
case exit of
ExitSuccess -> return (() <$ s)
ExitFailure code -> throw $ CommandError cmd code |
Is it impossible to implement |
yeah, |
it would be possible for |
What would you recommend as a proper solution to this ? I want to run a process and apply my combined effects to its outputs (stdout and stderr) in a streaming manner. Maybe |
Does that mean I should switch from |
you can use both in different places if you don't want to change everything. |
Alright. Thanks for your help |
Switching to a different effect library that provides both |
Say I want to implement a function using
lifted-async
such as:Since
Concurrently m
can only derive anApplicative
instance ifm
has an instance ofMonadBaseControl IO
, I can't construct my application to pass torunConcurrently
:I'm not competent enough to figure this out myself I'm sorry to say, since I have next to zero understanding of
MonadBaseControl
, and I'm not an expert onpolysemy
's machinery either. Is there an obvious solution I missed, or is some implementation required to interoperate those two things ?The text was updated successfully, but these errors were encountered: