The step algebra should be able to be optimized by running a peephole algorithm.
Keep removing redundant expressions (Compose(Lift(f), Lift(g)) => Lift(f andThen g)) a'la chris okasaki's red-black tree rotations or someting similar. This can even have an impact on the semantics for choice, opening up new batching opportunities!
Lift -> Effect -> Lift => Lift -> Effect if we have Functor.
Lift -> Effect -> Lift -> Effect => Lift -> Effect if we have Monad
The step algebra should be able to be optimized by running a peephole algorithm.
Keep removing redundant expressions (
Compose(Lift(f), Lift(g)) => Lift(f andThen g)
) a'la chris okasaki's red-black tree rotations or someting similar. This can even have an impact on the semantics for choice, opening up new batching opportunities!Lift -> Effect -> Lift
=>Lift -> Effect
if we haveFunctor
.Lift -> Effect -> Lift -> Effect
=>Lift -> Effect
if we haveMonad
Lift -> Effect -> Lift -> Stream
=>Lift -> Stream
withStream.eval(fa).flatMap(...)
Lift -> ... -> Arg
=>Arg
since inputs can safely be ignored, same with any input ignoring combinators.