Since Parser has a monad instance, Fold can also have one. We need to measure the performance and check at what point the direct style Fold/Parser monad becomes worse in performance compared to CPS. We can potentially have a static analysis tool to warn against heavier use of these.
Also, we can add a FoldK newtype wrapper over ParserK. If there is a significant difference in performance we can consider using a custom implementation of FoldK.
Since Parser has a monad instance, Fold can also have one. We need to measure the performance and check at what point the direct style Fold/Parser monad becomes worse in performance compared to CPS. We can potentially have a static analysis tool to warn against heavier use of these.
Also, we can add a
FoldK
newtype wrapper overParserK
. If there is a significant difference in performance we can consider using a custom implementation of FoldK.