aboutsummaryrefslogtreecommitdiff
path: root/src/expressions/collect_sources.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/expressions/collect_sources.ml')
-rw-r--r--[-rwxr-xr-x]src/expressions/collect_sources.ml29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/expressions/collect_sources.ml b/src/expressions/collect_sources.ml
index 32b40be..9698057 100755..100644
--- a/src/expressions/collect_sources.ml
+++ b/src/expressions/collect_sources.ml
@@ -29,7 +29,7 @@ module T = struct
let bool b = ()
- let observe () x = x
+ let observe : unit -> 'a -> 'a = fun () x -> x
end
@@ -39,7 +39,8 @@ module R = struct
type 'a t = 'a obs
- let cell (c:Cell.t) set = Cell.Set.add (Cell.to_pair c) set
+ let cell : Cell.t -> Cell.Set.t -> Cell.Set.t =
+ fun c set -> Cell.Set.add (Cell.to_pair c) set
let range c1 c2 set = begin
@@ -60,27 +61,25 @@ module R = struct
end
-let observe f value = f value
-
-let value v () = T.observe v
+type obs = Cell.Set.t -> Cell.Set.t
-let ref r () = R.observe r
+type t = obs
-let call0 ident () acc = acc
+let observe (f:obs) (value :Cell.Set.t) = f value
-let call1 ident p1 () acc = observe p1 acc
+let value v acc = T.observe v acc
-let call2 ident p1 p2 () acc = observe p2 (observe p1 acc)
+let ref r acc = R.observe r acc
-let call3 ident p1 p2 p3 () acc = observe p3 (observe p2 (observe p1 acc))
+let call0 ident acc = acc
-let callN ident params () acc = List.fold_left (fun acc p -> observe p acc) acc params
+let call1 ident p1 acc = observe p1 acc
-let expression e () = e
+let call2 ident p1 p2 acc = observe p2 (observe p1 acc)
-type obs = Cell.Set.t -> Cell.Set.t
+let call3 ident p1 p2 p3 acc = observe p3 (observe p2 (observe p1 acc))
-type t = unit
+let callN ident params acc = List.fold_left (fun acc p -> observe p acc) acc params
-type repr = obs
+let expression e acc = e acc