background preloader

Continuations

Facebook Twitter

Jetty

Conditionsystem. Scala continuations. Recursion is an essential part of functional programming.

scala continuations

But if each call allocates a stack frame, then too much recursion will overflow the stack. Most functional programming languages solve this problem by eliminating stack frames through a process called tail-call optimisation. Unfortunately for Scala programmers, the JVM doesn't perform this optimisation. Yet Another Language Geek : The Marvels of Monads. If the word "continuation" causes eyes to glaze over, then the word "monad" induces mental paralysis.

Yet Another Language Geek : The Marvels of Monads

Perhaps, this is why some have begun inventing more benign names for monads. These days, monads are the celebrities of programming language theory. They gloss the cover of blogs and have been compared to everything from boxes of fruit to love affairs.