Module Ben.Core

Utility functions and modules.

This module contains handy functions (or modules) not specific to Ben.

module StringSet : sig ... end
module StringMap : sig ... end
module IntMap : sig ... end
val with_in_channel : Stdlib.in_channel -> (Stdlib.in_channel -> 'a) -> 'a

Run the function on the in_channel, taking care of exceptions.

val with_in_file : string -> (Stdlib.in_channel -> 'a) -> 'a

Run the function on the given file, taking care of exceptions.

val with_out_file : string -> (Stdlib.out_channel -> 'a) -> 'a

Run the function on the given file, taking care of exceptions .

val escape_for_shell : string -> string

Quote a string for use with shell. For example, "a" is quoted into "'a'".

val rfc2822_of_time : float -> string

rfc2822_of_time t formats t (seconds since the epoch) as an RFC 2822 date in UTC, e.g. "Thu, 01 Jan 1970 00:00:00 +0000".

val get_rfc2822_date : unit -> string

Get the current date in RFC 2822 format, in UTC.

val uniq : 'a list -> 'a list

Remove duplicates in a list.

val capitalize : ?sep:char -> string -> string

capitalize ?sep s capitalizes a field name.