package core_extended

  1. Overview
  2. Docs

Write CSVs & CSV-like delimited formats.

type -'a t

Used to describe a way to create a single row of a CSV from a given type.

val empty : 'a t
val column : ('a -> string) -> header:string -> 'a t
val column_m : (module Delimited_kernel__.Write_intf.To_string with type t = 'a) -> header:string -> 'a t
val column_opt : ?default:string -> ('a -> string) -> header:string -> 'a option t

default is printed in place of None, and if not supplied is the empty string.

val column_m_opt : ?default:string -> (module Delimited_kernel__.Write_intf.To_string with type t = 'a) -> header:string -> 'a option t
val optional : ?default:string -> 'a t -> 'a option t

default is used for every column in the case of None.

val of_list : 'a t list -> 'a t
val append : 'a t -> 'a t -> 'a t
val contra_map : 'b t -> f:('a -> 'b) -> 'a t
val map_headers : 'a t -> f:(string -> string) -> 'a t
val headers : 'a t -> string list
val to_columns : 'a t -> 'a -> string list
val to_string : ?quote:char -> ?sep:char -> ?line_breaks:[ `Unix | `Windows ] -> write_header:bool -> 'a t -> 'a list -> string

Convert a list of 'a to a CSV document in a string.

module Fields_O : sig ... end

Open for prefix operators useful for using with Fields.to_list.

module O : sig ... end
module By_row : sig ... end
module Expert : sig ... end
module Out_channel : sig ... end

Wraps Stdio.Out_channel for writing CSVs one line at a time.

OCaml

Innovation. Community. Security.