Note that there are some explanatory texts on larger screens.

plurals
  1. PODon't understand the typing of Scala's delimited continuations (A @cpsParam[B,C])
    text
    copied!<p>I'm struggling to understand what precisely does it mean when a value has type <code>A @cpsParam[B,C]</code> and what types of this form should I assign to my values when using the delimited continuations facility.</p> <p>I've looked at some sources:</p> <p><a href="http://lamp.epfl.ch/~rompf/continuations-icfp09.pdf" rel="nofollow noreferrer">http://lamp.epfl.ch/~rompf/continuations-icfp09.pdf</a></p> <p><a href="http://www.scala-lang.org/node/2096" rel="nofollow noreferrer">http://www.scala-lang.org/node/2096</a></p> <p><a href="http://dcsobral.blogspot.com/2009/07/delimited-continuations-explained-in.html" rel="nofollow noreferrer">http://dcsobral.blogspot.com/2009/07/delimited-continuations-explained-in.html</a></p> <p><a href="http://blog.richdougherty.com/2009/02/delimited-continuations-in-scala_24.html" rel="nofollow noreferrer">http://blog.richdougherty.com/2009/02/delimited-continuations-in-scala_24.html</a></p> <p>but they didn't give me much intuition into this. In the last link, the author tries to give an explicit explanation, but it is not clear enough anyway.</p> <blockquote> <p>The A here represents the output of the computation, which is also the input to its continuation. The B represents the return type of that continuation, and the C represents its "final" return type—because shift can do further processing to the returned value and change its type. </p> </blockquote> <p>I don't understand the difference between "output of the computation", "return type of the continuation" and "final return type of the continuation". They sound like synonyms.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload