NAME

FP::Text::CSV - functional interface to Text::CSV

SYNOPSIS

 use FP::Text::CSV qw(csv_line_xparser csv_fh_to_rows csv_file_to_rows);
 use Method::Signatures; # func

 my $csvparams= +{sep_char=> ";", eol=> "\n"};
 # $csvparams and any of its entries are optional,
 #  defaults are taken from $FP::Text::CSV::defaults

 # -- Input: ---
 my $p= csv_line_xparser $csvparams;
 my @vals= &$p("1;2;3;4\n");

 my $stream= csv_fh_to_rows($somefilehandle, $csvparams);
 # or
 my $stream= csv_file_to_rows($somepath, $csvparams);

 # then
 use FP::Stream ":all";
 my $stream2= stream_map func ($row) {
     #...
 }, $stream;
 # etc.

 # -- Output: ---
 my $rows=
   cons [ "i", "i^2" ],
     stream_map func ($i) {
	 [ $i, $i*$i ]
     }, stream_iota;
 rows_to_csv_fh ($rows, $somefilehandle);
 # or
 rows_to_csv_file ($rows, "path");

DESCRIPTION

Handle CSV input and output in the form of functional streams (lazily computed linked lists).