kirancodes.me
To Proof Maintenance & Beyond!

Reflection without remorse: revealing a hidden sequence to speed up monadic reflection

Atze van der Ploeg, Oleg Kiselyov

Abstract

A series of list appends or monadic binds for many monads performs algorithmically worse when left-associated. Continuation-passing style (CPS) is well-known to cure this severe dependence of performance on the association pattern. The advantage of CPS dwindles or disappears if we have to examine or modify the intermediate result of a series of appends or binds, before continuing the series. Such examination is frequently needed, for example, to control search in non-determinism monads.

Related papers