package extlib

  1. Overview
  2. Docs

Module StdSource

Additional functions.

Sourceval input_lines : in_channel -> string Enum.t

Returns an enumeration over lines of an input channel, as read by the input_line function.

Sourceval input_chars : in_channel -> char Enum.t

Returns an enumeration over characters of an input channel.

Sourceval input_list : in_channel -> string list

Returns the list of lines read from an input channel.

Sourceval input_all : in_channel -> string

Return the whole contents of an input channel as a single string.

Sourceval print_bool : bool -> unit

Print a boolean to stdout.

Sourceval prerr_bool : bool -> unit

Print a boolean to stderr.

Sourceval input_file : ?bin:bool -> string -> string

returns the data of a given filename.

Sourceval output_file : filename:string -> text:string -> unit

creates a filename, write text into it and close it.

Sourceval string_of_char : char -> string

creates a string from a char.

Sourceval identity : 'a -> 'a

the identity function.

Sourceval unique : unit -> int

returns an unique identifier every time it is called.

Sourceval dump : 'a -> string

represent a runtime value as a string. Since types are lost at compile time, the representation might not match your type. For example, None will be printed 0 since they share the same runtime representation.

Sourceval print : 'a -> unit

print the representation of a runtime value on stdout. See remarks for dump.

Sourceval finally : (unit -> unit) -> ('a -> 'b) -> 'a -> 'b

finally fend f x calls f x and then fend() even if f x raised an exception.

OCaml

Innovation. Community. Security.