FSharpPlus
FSharpPlus copied to clipboard
Bind for Expr<'T> (Quotation Monad)
After a short but interesting discussion with @eiriktsarpalis I thought it might be interesting to add a Bind implementation for Expr<'t> which allows to combine functions returning quotations.
One open question is how the quotation will be evaluated, however I did a draft some years ago which uses the splice operator to signify that there is an evaluation at that point, together with a runUntyped function which accepts any quotation evaluator and makes sure all splices are evaluated properly.
It might be worth adding a specific implementation of quotation evaluator to this library, but it has to be very efficient. At the moment I wrote that code there were no efficient implementations around.