Module Talon.Row
Row-wise computations using an applicative interface.
Applicative interface
val return : 'a -> 'a rowreturn x is a computation that produces x for every row.
apply f x is the computation that applies f to x for each row.
map x ~f is the computation that applies f to each row's value from x.
map2 x y ~f is the computation that applies f to corresponding values from x and y.
map3 x y z ~f combines three computations with f.
both x y is the computation that pairs values from x and y.
Column accessors
val float32 : string -> float rowfloat32 name extracts float32 values from column name.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not float32 type.
val float64 : string -> float rowfloat64 name extracts float64 values from column name.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not float64 type.
val int32 : string -> int32 rowint32 name extracts int32 values from column name.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not int32 type.
val int64 : string -> int64 rowint64 name extracts int64 values from column name.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not int64 type.
val string : string -> string rowstring name extracts string values from column name.
Note. Null values are converted to empty strings.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not string type.
val bool : string -> bool rowbool name extracts boolean values from column name.
Note. Null values are converted to false.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not boolean type.
val number : string -> float rownumber name extracts numeric values from column name, coercing all numeric types to float.
Note. Null values become nan.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not a numeric type.
Row information
val index : int rowindex is the current row index (0-based).
sequence xs is the computation that collects values from all computations in xs into a list.
fold_list xs ~init ~f folds f over the computations in xs without creating an intermediate list.
Option-based accessors
These accessors return None for null values instead of using placeholder values. Use these when you need to distinguish genuine values from missing data.
val float32_opt : string -> float option rowfloat32_opt name extracts float32 values as options from column name. None for null values.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not float32 type.
val float64_opt : string -> float option rowfloat64_opt name extracts float64 values as options from column name. None for null values.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not float64 type.
val int32_opt : string -> int32 option rowint32_opt name extracts int32 values as options from column name. None for null values.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not int32 type.
val int64_opt : string -> int64 option rowint64_opt name extracts int64 values as options from column name. None for null values.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not int64 type.
val string_opt : string -> string option rowstring_opt name extracts string values as options from column name. None for null values.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not string type.
val bool_opt : string -> bool option rowbool_opt name extracts boolean values as options from column name. None for null values.
Raises Not_found if the column does not exist. Raises Invalid_argument if the column is not boolean type.