(* This file is part of licht. licht is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. licht is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with licht. If not, see . *) module type DATA_SIG = sig type 'a t type 'a returnType val compare_typ: 'a t -> 'b t -> ('a, 'b) Tools.cmp val repr: Format.formatter -> 'a t -> unit end module type CATALOG = sig type 'a argument type 'a returnType type t (** Create a new catalog builder used for registering all the functions *) type catalog_builder (** Empty catalog *) val empty: catalog_builder val register1: string -> (* The function name *) 'a argument -> (* The signature *) 'b returnType -> (* The return type *) ('a -> 'b) -> (* The function to call *) catalog_builder -> catalog_builder val register2: string -> (* The function name *) ('a argument * 'b argument) ->(* The signature *) 'c returnType -> (* The return type *) ( 'a -> 'b -> 'c) -> (* The function to call*) catalog_builder -> catalog_builder val register3: string -> (* The function name *) ('a argument * 'b argument * 'c argument) -> (* The signature *) 'd returnType -> (* The return type *) ( 'a -> 'b -> 'c -> 'd) -> (* The function to call*) catalog_builder -> catalog_builder (** Compile the catalog *) val compile: catalog_builder -> t type result = | R : 'a returnType * 'a -> result val eval1: t -> string -> ('a argument * 'a) -> result val eval2: t -> string -> ('a argument * 'a) -> ('b argument * 'b) -> result val eval3: t -> string -> ('a argument * 'a) -> ('b argument * 'b) -> ('c argument * 'c) -> result end module Make(D:DATA_SIG) : CATALOG with type 'a argument = 'a D.t and type 'a returnType = 'a D.returnType