module OLinq_table:sig..end
This table is designed for holding relational data over scalar values (strings, intergers, bools, etc.). It trades type-safety for flexibility, and should be well-suited to dealing with CSV-encoded data.
STATUS: EXPERIMENTAL
type'aprinter =Format.formatter -> 'a -> unit
type'asequence =('a -> unit) -> unit
type data =
| |
S of |
| |
I of |
| |
B of |
| |
F of |
module Data:sig..end
val int : int -> data
val float : float -> data
val bool : bool -> data
val string : string -> datatyperow =data array
exception IndexError
module Row:sig..end
exception DimError
type t
val create : ?size:int -> names:string array -> unit -> tcreate ~names () creates a new table with columns
labelled with namesval init : names:string array -> int -> (int -> row) -> tinit ~names n f makes a table with size rows,
each initialized from fDimError if some row returned by f doesn't have
the same size as namesval make : names:string array -> int -> row -> tinit ~names n row makes a table with size rows, all equal to rowDimError if Row.size row <> length namesval num_rows : t -> int
val num_cols : t -> int
val size : t -> intOLinq_table.num_rowsval names : t -> string arrayval get : int -> t -> row optionget n tbl gets the n-th rowval get_exn : int -> t -> rowIndexError if the index is invalidval get_cell : int -> int -> t -> data optionget_cell i j tbl gets the j-th value of the i-th rowval get_cell_exn : int -> int -> t -> dataIndexError if the index is invalidval fold : f:('acc -> row -> 'acc) -> x:'acc -> t -> 'acc
val iter : f:(row -> unit) -> t -> unit
val iteri : f:(int -> row -> unit) -> t -> unit
val push : t -> row -> unitDimError if the row has not the same dimension as tableval push_l : t -> row list -> unitDimError if some row has not the same dimension as tableval push_seq : t -> row sequence -> unitDimError if some row has not the same dimension as tableval to_seq : t -> row sequence
val to_list : t -> row list
val to_list_rev : t -> row list
val print : t printer