package olinq

  1. Overview
  2. Docs

Module OLinq.IOSource

Sourceval read_chan : in_channel -> (string, [> `One ]) t

Read the content of the whole channel in (blocking), returning the corresponding string. The channel will be read at most once during execution, and its content cached; however the channel might never get read because evaluation is lazy.

Sourceval read_file : string -> (string, [> `One ]) t

Read a whole file (given by name) and return its content as a string

Sourceval lines : (string, _) t -> (string, [ `Any ]) t

Convert a string into a collection of lines

Sourceval lines_l : (string, 'card) t -> (string list, 'card) t

Convert each string into a list of lines

Sourceval concat : string -> (string, _) t -> (string, [> `One ]) t

concat sep q joins all the strings in q together, similar to String.concat sep (run_list q) basically.

Sourceval unlines : (string, _) t -> (string, [> `One ]) t

Join lines together

Sourceval out : out_channel -> (string, _) t -> unit
Sourceval out_lines : out_channel -> (string, _) t -> unit

Evaluate the query and print it line by line on the output

Run methods
Sourceval to_file : string -> (string, _) t -> unit or_error
Sourceval to_file_exn : string -> (string, _) t -> unit
Sourceval to_file_lines : string -> (string, _) t -> unit or_error
Sourceval to_file_lines_exn : string -> (string, _) t -> unit