diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2017-06-19 08:31:23 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2017-06-19 10:16:01 +0200 |
commit | e15df3a924abed6135477bac0837a7fde250f02d (patch) | |
tree | 5f8e59c2aeadefa73e1c4faf9306937f91b5371a /catalog.mli | |
parent | 8db278b1e6331d55ef6aa11964c88144af3c4fce (diff) |
Moved catalog in its own module
Diffstat (limited to 'catalog.mli')
-rw-r--r--[-rwxr-xr-x] | catalog.mli | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/catalog.mli b/catalog.mli index 583db14..d2bb707 100755..100644 --- a/catalog.mli +++ b/catalog.mli @@ -1,4 +1,34 @@ -
-val register: UTF8.t -> (ScTypes.types list -> ScTypes.types) -> unit
-
-val eval: UTF8.t -> ScTypes.types list -> ScTypes.types
+module type DATA_SIG = sig + + type 'a typ + + type 'a result + + val compare_typ: 'a typ -> 'b typ -> ('a, 'b) Tools.cmp + +end + +module Make(D:DATA_SIG): sig + + type t + + type 'a t_function = + | Fn1: 'b D.result * ('a -> 'b) -> 'a t_function + | Fn2: 'c D.result * ('a -> 'b -> 'c) -> ('a * 'b) t_function + | Fn3: 'd D.result * ('a -> 'b -> 'c -> 'd) -> ('a * 'b * 'c) t_function + + type 'a sig_typ = + | T1: 'a D.typ -> 'a t_function sig_typ + | T2: 'a D.typ * 'b D.typ -> ('a * 'b) t_function sig_typ + | T3: 'a D.typ * 'b D.typ * 'c D.typ -> ('a * 'b * 'c) t_function sig_typ + + (** Empty catalog *) + val empty: t + + (** Register a new function in the catalog *) + val register : t -> string -> 'a sig_typ -> 'a -> t + + (** Find a function with the given name and signature *) + val find_function: t -> string -> 'a t_function sig_typ -> 'a t_function + +end |