Skip to content
Discussion options

You must be logged in to vote

There's no way to execute a generic MonadLiftIO, and to Run an Eff<RT> you'd need access to an instance of the runtime, which you wouldn't have in imperative async code.

If you do depend on the computation actually being an Eff, then you could/should remove a lot of the generic type params throughout the whole call stack, and you can just do

    public static Eff<RT, Unit> ProcessParallel<RT>(
        this IEnumerable<Eff<RT, Unit>> computations,
        int parallelism = 1) =>
        Eff.lift<RT, Unit>(
            async (rt) =>
               {
                   await Parallel.ForEachAsync(
                        computations, 
                           new ParallelOptions { MaxDegr…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@djm132
Comment options

@micmarsh
Comment options

@djm132
Comment options

@micmarsh
Comment options

@djm132
Comment options

Answer selected by djm132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1556 on May 19, 2026 13:01.