Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use shift0. add operators for direct/read

  • Loading branch information...
commit 75c421b58675e38c57d3ec5113c620c1cc83f015 1 parent 592da5c
Jake Donham authored
Showing with 11 additions and 8 deletions.
  1. +8 −8 src/froc-direct/froc_direct.ml
  2. +3 −0  src/froc-direct/froc_direct.mli
View
16 src/froc-direct/froc_direct.ml
@@ -21,13 +21,13 @@ let read t =
| Some p -> p in
active_prompt := None;
- Delimcc.take_subcont p begin fun sk () ->
- Froc.notify_result_b t begin fun r ->
+ Delimcc.shift0 p begin fun k ->
+ Froc.notify_result_b t begin fun _ ->
active_prompt := Some p;
- Delimcc.push_delim_subcont sk begin fun () ->
- match r with
- | Froc.Value v -> v
- | Froc.Fail e -> raise e
- end
+ k ()
end
- end
+ end;
+ Froc.sample t
+
+let (~|) = direct
+let (~.) = read
View
3  src/froc-direct/froc_direct.mli
@@ -1,2 +1,5 @@
val direct : (unit -> 'a) -> 'a Froc.behavior
val read : 'a Froc.behavior -> 'a
+
+val (~|) : (unit -> 'a) -> 'a Froc.behavior
+val (~.) : 'a Froc.behavior -> 'a
Please sign in to comment.
Something went wrong with that request. Please try again.