Understanding the multi-protocol delimited continuation API

The API for continuing with a few hints is described in the article "Limited control" in OCaml, "Absolutely and specifically the description of the system . "

My question is about type push_subcont : ('a,'b) subcont -> (unit -> 'a) -> 'b. Why is this type not ('a,'b) subcont -> 'a -> 'b? Also, why is there a separate type for subconts: why not just ('a,'b) subcont = 'a -> 'b? I am almost sure that there is a good reason for this, because Oleg makes things as elegant as possible (but no more elegant).

Thank!

+5
source share
1 answer

Why not ('a,'b) subcont -> 'a -> 'b?

, , push_prompt - . push_prompt p (fun () -> e) try e with p: p , e . push_prompt p e, p e, e " " , .

push_subcont sk (fun () -> e) : : " sk, ". , e , , , , , sk.

('a,'b) subcont = 'a -> 'b?

, : " " , .

: push_subcont push_delim_subcont, , . "" , . , .

+5

All Articles