From 824f2987d47e87d58ee2a4a96d7be417aad6aeab Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 31 Jan 2018 13:20:20 +0100 Subject: API refactoring : made the GADT abstract, provide contructor for each case, and deported the expression with evaluation with module functors --- src/functions.ml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/functions.ml') diff --git a/src/functions.ml b/src/functions.ml index 62426e9..309de6c 100755 --- a/src/functions.ml +++ b/src/functions.ml @@ -14,11 +14,11 @@ let t_int: DataType.Num.t typ = Num let t_string: UTF8.t typ = String let t_list (t: 'a typ): 'a list typ = List t -let typ_of_format: type a. a ScTypes.dataFormat -> a typ = function - | ScTypes.Date -> Num - | ScTypes.Number -> Num - | ScTypes.String -> String - | ScTypes.Bool -> Bool +let typ_of_format: type a. a ScTypes.DataFormat.t -> a typ = function + | ScTypes.DataFormat.Date -> Num + | ScTypes.DataFormat.Number -> Num + | ScTypes.DataFormat.String -> String + | ScTypes.DataFormat.Bool -> Bool let rec repr: @@ -53,16 +53,16 @@ module C = Catalog.Make(struct type 'a t = 'a typ - type 'a returnType = 'a ScTypes.returnType + type 'a returnType = 'a ScTypes.ReturnType.t end) -let f_num = ScTypes.f_num -let f_date = ScTypes.f_date -let f_number = ScTypes.f_number -let f_string = ScTypes.f_string -let f_bool = ScTypes.f_bool +let f_num = ScTypes.ReturnType.f_num +let f_date = ScTypes.ReturnType.f_date +let f_number = ScTypes.ReturnType.f_number +let f_string = ScTypes.ReturnType.f_string +let f_bool = ScTypes.ReturnType.f_bool module Make_Compare(Comp: D.COMPARABLE) = struct -- cgit v1.2.3