
On Wed, 31 Dec 2014, Cary Cherng
I read (http://en.wikibooks.org/wiki/Haskell/Continuation_passing_style) that in some circumstances, CPS can be used to improve performance by eliminating certain construction-pattern matching sequences (i.e. a function returns a complex structure which the caller will at some point deconstruct). And that attoparsec is an example of this.
I don't see exactly how CPS gives rise to concrete examples of performance gains. Moreover how does this arise in parsing for example with attoparsec as mentioned.
I also encountered various web frameworks such as mflow that are based on continuations. How a typical http restful system is made into something based around continuations is not something that is obvious to me. And what is gained from that?
I just found this delightful article by John C. Reynolds: The Discoveries of Continuations http://www.math.bas.bg/bantchev/place/iswim/conti-disco.pdf oo--JS.