acgtk

Abstract Categorial Grammar development toolkit
Library acgtkLib.utilsLib
Module UtilsLib . Utils
module StringSet : Stdlib.Set.S with type elt = Stdlib.String.t

StringSet is a module for sets of strings

module StringMap : Stdlib.Map.S with type key = Stdlib.String.t

StringMap is module for maps from strings to type 'a

module IntMap : Stdlib.Map.S with type key = int

IntMap is a module for maps from int to type 'a

module IntSet : Stdlib.Set.S with type elt = int

IntSet is a module for sets of int

val string_of_list : string -> ( 'a -> string ) -> 'a list -> string

string_of_list sep to_string [a_1;...;a_n] returns a string made of the strings to_string a_1 ... to_string a_n concatenated with the separator sep between each of the elements (if the list is of length greater than 2)

val intersperse : 'a -> 'a list -> 'a list

intersperse sep [a_1;...;a_n] returns a list where elements of the input list are interspersed with sep as in a_1; sep; a_2; sep; ...; sep; a_n.

val cycle : int -> 'a list -> 'a list

cycle n xs returns the first n elements of the infinite list formed by cyclically repeating the elements of xs. Returns the empty list if xs is empty.

val fold_left1 : ( 'a -> 'a -> 'a ) -> 'a list -> 'a

fold_left1 plus elems sums up the elements in elems using plus. A generalization of List.fold_left from monoids to semigroups, where we don't have any neutral element. Assumes elems is non-empty.

val term_set_size : unit -> unit
val sterm_set_size : unit -> unit
val fterm_set_size : Stdlib.Format.formatter -> unit
val no_pp : unit -> unit
val fformat : Stdlib.Format.formatter -> ( 'a, Stdlib.Format.formatter, unit ) Stdlib.format -> 'a
val format : ( 'a, Stdlib.Format.formatter, unit ) Stdlib.format -> 'a
val sformat : ( 'a, Stdlib.Format.formatter, unit ) Stdlib.format -> 'a
val format_of_list : Stdlib.Format.formatter -> string -> ( 'a -> string ) -> 'a list -> unit
val blue : string -> string
val red : string -> string
val green : string -> string
val string_of_list_rev : string -> ( 'a -> string ) -> 'a list -> string

string_of_list_rev sep to_string [a_1;...;a_n] returns a string made of the strings to_string a_n ... to_string a_1 concatenated with the separator sep between each of the elements (if the list is of length greater than 2)

exception No_file of string * string

No_file (file_name,msg) is raised when the file file_name is not found in any of the directories given to the Utils.find_file function with the message msg

val find_file : string -> string list -> string

find_file f dirs tries to find a file with the name f in the directories listed in dirs. If it finds it in dir, it returns the full name Filename.concat dir f. To check in the current directory, add "" to the list. It tries in the directories of dirs in this order and stops when it finds such a file. If it can't find any such file, raise the exception No_file(f,msg) where msg contains a string describing where the file f was looked for.

val (>>) : ( 'b -> 'c ) -> ( 'a -> 'b ) -> 'a -> 'c

This function is useless when Bolt log level is NONE