To have the trace of an unexpected error is very important in Web development. Specially when the error has been produced in the exploitation environment. There is no way to make tests in a exploitation environment, so the error message is the only information available to fix it as soon as possible.
Now MFlow permits the creation of execution traces. Not just call traces, but execution traces, whenever an error happens. It uses the package monadloc from Pepe Iborra, used to produce stack traces in his package control-monad-exception.
Using MonadLoc, MFlow can produce entire traces instead of call stacks because his backtracking mechanism permits to run back the execution up to the beginning in case of an exception following the exact execution steps in reverse order. In this back-execution is when the trace is generated. When running normally, the tracing machinery does not affect the performance.
This is an example of what it is necessary in order to have execution traces in case of error. It is necessary to install the monadloc-pp and monadloc packages that install the monadloc preprocessor and the monadloc class respectively. There are two according changes in the user programs, the preprocessor directive and to include the Control.Monad.Loc module.
EDIT: The persistent flows have no MonadLoc instance, but since the persistent flows have forward logs, it is possible to trace the execution. Once an error is produced in a persistent flow, its log is moved to the error subdirectory within the .tcachedata folder. Since a flow can have persistent and non persistent sections (depending where they use the step statement) In the future, both logging mechanisms will be integrated in the same error message.