module Toolkit:Some small functions and shortcuts which I find convenient.sig
..end
val (%) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
val toggle : bool Pervasives.ref -> unit
exception Empty_option
val opt_get : 'a option -> 'a
val opt_getd : 'a -> 'a option -> 'a
module Global:sig
..end
type'a
global ='a Global.t
val aggreg_args : string list -> string
val is_blank_char : char -> bool
val trim : string -> string
I have modified the first two so that they always return the string instead of
raising exceptions, which is what I need most of the time.
val first_chars : string -> int -> string
first_chars s n
returns the first n
characters of s
, and s
itself if n
is too bigval last_chars : string -> int -> string
last_chars s n
returns the last n
characters of s
, and s
itself if n
is too bigval string_before : string -> int -> string
string_before s n
returns the substring of all characters of s
that precede position n
(excluding the character at
position n
).val string_after : string -> int -> string
string_after s n
returns the substring of all characters of s
that follow position n
(including the character at
position n
).val snippet : string -> int -> string
n+3
chars, the extra three being the "..." if the string
is trunctatedval subb : string -> int -> int -> string
String.sub
, extracts between two positions, inclusivelyval pluralise : string -> int -> string
n
> 2val map_tr : ('a -> 'b) -> 'a list -> 'b list
val no_newline : string -> string
val lines_of_file : ?f:(string -> string) -> string -> string list
val run_on_file : (string -> 'a) -> string -> unit
val pl : string -> unit
val pe : string -> unit
val ps : string -> unit
val pf : ('a, Pervasives.out_channel, unit) Pervasives.format -> 'a
Printf.printf
: formated printing to stdoutval spf : ('a, unit, string) Pervasives.format -> 'a
Printf.sprintf
: formated printing to stringval epf : ('a, Pervasives.out_channel, unit) Pervasives.format -> 'a
Printf.eprintf
: formated printing to stderrval fpf : Pervasives.out_channel ->
('a, Pervasives.out_channel, unit) Pervasives.format -> 'a
Printf.fprintf
: formated printing to output channelval va : ('a, unit, string) Pervasives.format -> 'a
spf
: formated printing to stdoutval tl : 'a list -> 'a list
val hd : 'a list -> 'a
val sof : float -> string
string_of_float
val fos : string -> float
float_of_string
val soi : int -> string
string_of_int
val ios : string -> int
int_of_string
val iof : float -> int
int_of_float
val foi : int -> float
float_of_int
val soff : float -> string
val iosd : string -> string -> int
ios
with debug instructionsval iosz : string -> int
ios
with zero in case of failureval strlen : string -> int
val listlen : 'a list -> int
val arrlen : 'a array -> int
val break_string : string -> unit
val stdinc : Pervasives.in_channel
stdin
as input channelval stdoutc : Pervasives.out_channel
stdout
as output channelval stdinf : Unix.file_descr
stdin
as a file descriptorval stdoutf : Unix.file_descr
stdout
as a file descriptorval hue : ('a -> 'b) -> 'a -> 'b
Unix.handle_unix_error
val open_out_append : string -> Pervasives.out_channel
val getport : string -> int
val pidd : string -> unit
val cpipe : ?nonblock:bool -> unit -> Pervasives.in_channel * Pervasives.out_channel
val pdfork : ?nb:bool ->
(Pervasives.in_channel -> Pervasives.out_channel -> unit) ->
Pervasives.in_channel * Pervasives.out_channel
(channel reading from the son, channel writing to the son)
nb
: is reading non-blocking ?f
: function the son will be executing. It takes two arguments: the channels to reading from the son and writing to the son, respectively.val peek_line : Pervasives.in_channel -> string option
input_line
for non-blocking channels. None
is returned if nothing is there.val string_of_sockaddr : Unix.sockaddr -> string
val repeat_pattern : string -> int -> string
val separator_double_line : string
val separator_line : string
val separator_solid_line : string
val av : string array
val ac : int
val al : string list
val bad_args : string -> unit