diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2017-11-01 14:53:09 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2017-11-01 14:53:09 +0100 |
commit | 9fbc5e48ea8183dda8fdb652364c0c29f8a309d5 (patch) | |
tree | 052214454101b44d07918131ad500f0c451649eb /scTypes.ml | |
parent | ab721136f50914a21f6cca89f0fcfb055ba58cd2 (diff) |
Made scTypes.types private.
Diffstat (limited to 'scTypes.ml')
-rw-r--r--[-rwxr-xr-x] | scTypes.ml | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scTypes.ml b/scTypes.ml index f8c3d38..ff0af83 100755..100644 --- a/scTypes.ml +++ b/scTypes.ml @@ -13,8 +13,8 @@ type 'a number_format = (float -> 'a, Format.formatter, unit) format type _ dataFormat = | Date: DataType.Num.t dataFormat (* Date *) | Number: DataType.Num.t dataFormat (* Number *) - | String: DataType.String.t dataFormat (* String result, there is only one representation *) - | Bool: DataType.Bool.t dataFormat (* Boolean result *) + | String: DataType.String.t dataFormat(* String *) + | Bool: DataType.Bool.t dataFormat (* Boolean *) type numericType = | Date @@ -32,13 +32,20 @@ let priority: type a. a dataFormat -> int = function type 'a types = | Num : DataType.Num.t dataFormat * DataType.Num.t -> DataType.Num.t types (** A number *) - | Str : DataType.String.t -> DataType.String.t types (** A string *) - | Bool : DataType.Bool.t -> DataType.Bool.t types (** A boolean *) + | Str : DataType.String.t -> DataType.String.t types (** A string *) + | Bool : DataType.Bool.t -> DataType.Bool.t types (** A boolean *) + +let number n = Num (Number, n) +let string s = Str s +let date d = Num (Date, d) +let boolean b = Bool b + type 'a returnType = | Num : DataType.Num.t dataFormat option -> DataType.Num.t returnType (** A number *) - | Str : DataType.String.t returnType (** A string *) - | Bool : DataType.Bool.t returnType (** A boolean *) + | Str : DataType.String.t returnType (** A string *) + | Bool : DataType.Bool.t returnType (** A boolean *) + let f_num: DataType.Num.t returnType = Num None let f_date: DataType.Num.t returnType = Num (Some Date) |