Internal utility functions that are commonly needed in many
places. Within Biocaml, all modules start with "open
Core.Std". When needed, we can also open this module to get some
extra functions, but it should not be opened unless it is
specifically needed.
module Biocaml_internal_utils: sigmodule Line:module type of Biocaml_linewith type t = Biocaml_line.t
module Pos:module type of Biocaml_poswith type t = Biocaml_pos.t
module Stream: module type of CFStream_streamval (|?) : 'a option -> 'a -> 'amodule Array: siginclude Core.Std.Array
val range : 'a t -> int Biocaml_internal_utils.Stream.trange xs is the stream of all valid indices in xsendmodule Result: siginclude Core.Std.Result
endval try_finally_exn : fend:('a -> unit) -> ('a -> 'b) -> 'a -> 'btry_finally_exn fend f a will run x = f a, then run fend
a, and finally return x. If f a raised an exception that
exception will be returned even if f x raises an exception too. If
f a successfully produces x, then it is possible to get instead
an exception raised by fend a.val open_out_safe : string -> Pervasives.out_channelopen_out but will not overwrite existing file.Operations on URL-style encodings.
module Url: sigval escape : string -> string"%HX"
URL-escaping format.val unescape : string ->
error:(string -> 'error) -> (string, 'error) Biocaml_internal_utils.Result.t"%HX" escaped characters to a normal
string. In case of error, the string is passed to the ~error parameter
and the function returns its result.endmodule Debug: sigval enable : string -> unitval disable : string -> unitval make : string -> ('a, unit, string, unit) Pervasives.format4 -> 'aendval compare_of_list : ?equal:('a -> 'a -> bool) -> 'a list -> 'a -> 'a -> intcompare_of_list l returns a comparison function that defines a
< b if a comes before b in l. The returned function will
raise an exception if it is applied to any element not in l.end