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'a
printer =Format.formatter -> 'a -> unit
type'a
sequence =('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 -> data
typerow =
data array
exception IndexError
module Row:sig
..end
exception DimError
type
t
val create : ?size:int -> names:string array -> unit -> t
create ~names ()
creates a new table with columns
labelled with names
val init : names:string array -> int -> (int -> row) -> t
init ~names n f
makes a table with size
rows,
each initialized from f
DimError
if some row returned by f
doesn't have
the same size as names
val make : names:string array -> int -> row -> t
init ~names n row
makes a table with size
rows, all equal to row
DimError
if Row.size row <> length names
val num_rows : t -> int
val num_cols : t -> int
val size : t -> int
OLinq_table.num_rows
val names : t -> string array
val get : int -> t -> row option
get n tbl
gets the n
-th rowval get_exn : int -> t -> row
IndexError
if the index is invalidval get_cell : int -> int -> t -> data option
get_cell i j tbl
gets the j
-th value of the i
-th rowval get_cell_exn : int -> int -> t -> data
IndexError
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 -> unit
DimError
if the row has not the same dimension as tableval push_l : t -> row list -> unit
DimError
if some row has not the same dimension as tableval push_seq : t -> row sequence -> unit
DimError
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