You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recipe<'T> is a monad describing build actions. It currently conceptually involves state monad transformer over Async, primarily to track traversed targets. It should be relatively easy to add implicit parallelism using .Combine and Applicative operators (as can be done for plain Async, see 1).
Examples of desired implicit parallelism:
typeRecipe<'T>// describes how to cook a 'TtypeTarget<'T>// describes a target producing a 'TvalRecipe.Pure:'T ->Recipe<'T>valRecipe.(<*>):Recipe<'A->'B>->Recipe<'A>->Recipe<'B>valRecipe.Require:Target<'T>->Recipe<'T>// Non-monadic composition hopefully compiles to .Combine// which unlike Bind can be made parallel:
Recipe.Do {do! Recipe.Require Target1 // assuming Target<unit>do! Recipe.Require Target2
...}// Applicative composition always can be parallel:
Recipe.Pure (fun x y z -> f (x, y, z))<*> Recipe1
<*> Recipe2
<*> Recipe3
Interaction with logging: logging should not be a side-effect embedded into Async but instead a dedicated concept in Recipe<'T>. The idea is to execute a <*> b in parallel, but produce logs always in order - left-to-right, as soon as available.
Interaction with error reporting: can treat exceptions the same way as Async.Parallel - not sure if it currently reports the leftmost exception or combines them into AggregateException. I think the leftmost makes more sense.
The text was updated successfully, but these errors were encountered:
Recipe<'T>
is a monad describing build actions. It currently conceptually involves state monad transformer overAsync
, primarily to track traversed targets. It should be relatively easy to add implicit parallelism using.Combine
andApplicative
operators (as can be done for plainAsync
, see 1).Examples of desired implicit parallelism:
Interaction with logging: logging should not be a side-effect embedded into Async but instead a dedicated concept in
Recipe<'T>
. The idea is to executea <*> b
in parallel, but produce logs always in order - left-to-right, as soon as available.Interaction with error reporting: can treat exceptions the same way as
Async.Parallel
- not sure if it currently reports the leftmost exception or combines them intoAggregateException
. I think the leftmost makes more sense.The text was updated successfully, but these errors were encountered: