FAQ Database Discussion Community


Is Curry-Howard correspondent of double negation ((a->r)->r) or ((a->⊥)->⊥)?

haskell,continuations,curry-howard
Which is the Curry-Howard correspondent of double negation of a; (a -> r) -> r or (a -> ⊥) -> ⊥, or both? Both types can be encoded in Haskell as follows, where ⊥ is encoded as forall b. b. p1 :: forall r. ((a -> r) -> r) p2...

Any history background about the “yin-yang puzzle” in detail?

scheme,continuations
There are quite a few questions about the "yin-yang puzzle" already in Stackoverflow: How does the yin yang puzzle work? (I assume this is the first one) Haskell (this is my question) C# 5.0 Typed languages ... (there could be something I didn't find yet) I was wondering when and...

understanding call/cc in scheme

scheme,racket,continuations
Could someone please explain what happens once the continuation is called for this. ((cdr (or (call/cc (lambda (cc) (cons 2 (lambda () (cc #f))))) (cons 3 5)))) ((cdr (or (call/cc (lambda (cc) (cons 2 (lambda () (cc #f))))) (cons 3 (lambda() (+ 3 2)))))) The first statement gives error but...

What do “continuations” mean in functional programming?(Specfically SML)

recursion,functional-programming,sml,smlnj,continuations
I have read a lot about continuations and a very common definition I saw is, it returns the control state. I am taking a functional programming course taught in SML. Our professor defined continuations to be: "What keeps track of what we still have to do" ; "Gives us control...

sum of continuous values in matlab

matlab,matrix,max,continuations
I need to calculate the following in matlab. EDIT EDIT: I alway have a 16 x 3 matrix. 16 rows and 3 columns. The 3 columns represent R,G,B and the 16 rows represent points. From 1-16. An example matrix looks like this: 1 1 1 -1 0 0 0 0...

Implement yield and send in Scheme

scheme,coroutine,continuations,guile,delimited-continuations
I'm trying to port yield and yield from from Python to Scheme. Here is an implementation I've done: (define (coroutine routine) (let ((current routine) (status 'new)) (lambda* (#:optional value) (let ((continuation-and-value (call/cc (lambda (return) (let ((returner (lambda (value) (call/cc (lambda (next) (return (cons next value))))))) (if (equal? status 'new) (begin...

Task Continuation NullReferenceException

c#,task-parallel-library,async-await,continuations
So I have a continuation defined: var task = _httpClient.SendAsync(request, cts.Token); task.ContinueWith(i => { /* TODO: log */ }, TaskContinuationOptions.OnlyOnCanceled); var response = await task.ConfigureAwait(false); I get a compiler warning on the ContinueWith line: Because this call is not awaited, execution of the current method continues before the call is...

What exactly is a “continuation prompt?”

scheme,racket,continuations,delimited-continuations
I'm trying to decipher the documentation call-with-continuation-prompt Applies proc to the given args with the current continuation extended by a prompt. The prompt is tagged by prompt-tag, which must be a result from either default-continuation-prompt-tag (the default) or make-continuation-prompt-tag. The result of proc is the result of the call-with-continuation-prompt call....