David Erukhimovich
05/16/2022, 7:37 AM...
val = foo(val)
val = bar(val)
val = baz(val)
...
(foo, bar and baz are ops)
Now, bar
is optional - there is a configuration that allows the user to skip bar
and then the output of foo
will go strait to baz.
I can implement it naively with a simple condition in the beginning of bar
(and I did), but -
Can I visualize it better? represent it somehow in the DAG? maybe gray out the op during execution?
Thanks!Samuel Stütz
05/16/2022, 7:51 AMoptBazInput, optBarInput = foo(val)
bazInput = bar(optBarInput[required])
bazRes = baz(optBazInput[optional], bazInput[optional])
And definitely rename them.
But just returning both possible outcomes, functional slitly like an Either Tuple and then consume that tuple baz. Of course requires that in baz to have the logic coalesce the 2 optional inputs to one. So its a bit more code but you get it visualized in the graph.
Think of it as functional style code with hard/statically typed outputs than it usually maps to a valid DAG I think.David Erukhimovich
05/16/2022, 8:53 AM