From 112ab4b1c396fc2117191297227d8e411f9b9bb3 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 19 Jan 2018 11:24:29 +0100 Subject: Better memory management --- src/scTypes.mli | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/scTypes.mli') diff --git a/src/scTypes.mli b/src/scTypes.mli index 348f4fe..46b48c6 100755 --- a/src/scTypes.mli +++ b/src/scTypes.mli @@ -12,11 +12,6 @@ type 'a dataFormat = | String: DataType.String.t dataFormat (* String *) | Bool: DataType.Bool.t dataFormat (* Boolean *) -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 *) - type numericType = | Date | Number @@ -33,6 +28,8 @@ val string: DataType.String.t -> DataType.String.t types val boolean: DataType.Bool.t -> DataType.Bool.t types val date: DataType.Num.t -> DataType.Num.t types +(** Private type for an internal representation of return format *) +type 'a returnType (** Numeric (any format) *) val f_num: DataType.Num.t returnType @@ -92,25 +89,25 @@ module Refs : sig | Array1 of 'a list | Array2 of 'a list list + (* Collect all the cells defined by a range. The cell are defined by their + coordinates *) val collect: refs -> (int * int) range val map: ('a -> 'b) -> 'a range -> 'b range - + val shift: (int * int) -> refs -> refs - type 'a content = - | Value: 'a dataFormat * 'a -> 'a content - | List: 'a dataFormat * 'a list -> 'a list content - | Matrix: 'a dataFormat * 'a list list -> 'a list list content - - type refContent = - | C: 'a content -> refContent [@@unboxed] + (** Each content from a reference contains a format and the appropriate value. *) + type content = + | Value: 'a dataFormat * 'a -> content + | List: 'a dataFormat * 'a list -> content + | Matrix: 'a dataFormat * 'a list list -> content (** extract the content from a range. May raise Errors.TypeError if the range cannot be unified. *) - val get_content : result option range -> refContent + val get_content : result option range -> content end -- cgit v1.2.3