TomasMikula / libretto

Declarative concurrency and stream processing library for Scala
Mozilla Public License 2.0
199 stars 7 forks source link

Don't require inversions for reverse lambdas #76

Open TomasMikula opened 1 year ago

TomasMikula commented 1 year ago

The reverse lambda, i.e. producing in

 λ { (a: $[A]) =>
  producing { (b: ??[B]) =>
    // ...
  }
} : A -⚬ B

where b is a placeholder for the out-port, is currently implemented via a forward lambda on an inverted expression (??[B] = $[-[B]]).

This has 2 drawbacks:

However, reverse lambdas can be implemented without inversions. Note that it will require some changes (generalizations) in the implementation of lambda translation, though.