Parse a spec that chains tasks serially with commas and in parallel with braces and semicolons, and output every nested call expression it expands to.
Unlock detailed company stats for this questionUpgrade
A workflow system composes tasks. Each task is a function whose first argument is its input, followed by optional positional and keyword arguments, and it returns a value of the same type as its input. A specification string, in which whitespace is ignored, says how to chain tasks. Tasks separated by commas run in series, so a,b,c becomes c(b(a(input))). Tasks separated by semicolons inside curly braces run in parallel and give one code path each, so a,{b;c} becomes b(a(input)) and c(a(input)). An empty task is allowed inside braces and leaves the expression unchanged, so a,{b;} becomes b(a(input)) and a(input). Commas never separate tasks inside braces. A task's own arguments follow its name in parentheses and are placed after the input, so a('x',k=1),b(2) becomes b(a(input,'x',k=1),2). Several brace groups in series multiply out, so {a;b},{c;d} gives four code paths. Given a specification, output every resulting expression.
Community answers
No answers contributed by the community yet.
Related courses

Course
