Steps preprocessor
Consider the following expression:
return f()->bind($x ==>
g($x)->bind($y ==>
Option::some($x + $y)));
Not exactly what you'd call readable. The steps preprocessor, found in tools/steps.pl
, is an experimental Perl script that makes it less tedious to work with bind
. With the steps preprocessor, the above expression can be rewritten as follows:
return steps {
$x <- f();
$y <- g($x);
Option::some($x + $y);
};
This syntax resembles do notation in Haskell and query expressions in C#.