Spotlib.SpotSourceinclude module type of struct include Base endResult/Either monad using polymorphic variant. Obsolete. Use the primitive type result instead.
Functional composition. Haskell's (.) Use power if you want to use the original ( ** ).
Same as ( ** ).
Functional composition in swapped order. Same as Haskell's (>>>)
Replacement of ( ** )
Haskell's ($).
Haskell's ($), with label 'f'.
"tee". v |-- f is v but f v is run before v is returned
flip of Haskell
Super flip of Haskell. The first argument is labeled and becomes commutative.
Super flip of Haskell. The first argument is labeled and becomes commutative.
flip f x2 x3 x1 = f x1 x2 x3
with_ref and with_ref_ runs a function with a reference with the specified initial value.
Printf.sprintf is available without tying Printf.
Printf.ksprintf is available without tying Printf.
Format.eprintf, prefix style.
Generic memozation by hash with fixed point. You can call memoized self inside:
memoize_gen (fun self -> .... self v ....) f
Memozation by hash
Memozation by hash with fixed point. You can call memoized self inside:
memoize_rec (fun self -> .... self v ....) f
Simple profiling. Returns seconds. If f a raises an exception e, then time f a raises e too.
val find_by_iter :
(('a -> unit) -> 'collection -> unit) ->
('a -> bool) ->
'collection ->
'a optionfind the first element where predicate holds by iteration find_by_iter iterator predicate colleciton
find_in_tree get_subs p a visits a and finds the first sub node in which p holds. get_subs returns the sub nodes of a node.
Keep repeating a function until a final result is producted.
compare_on f a b compares a and b not by themselves but by f a and f b.
rev_compare_on f a b = - (compare_on f a b)
add_if_not_mem adds a to asref if not (List.mem a !asref) then return `NewlyAdded. Otherwise it returns `AlreadIn and asref is not modified.
String <-> bytes conversions
include module type of struct include Option.Stdlib endmay raise Invalid_argument
include module type of struct include Result.Stdlib endinclude module type of struct include Exn.Stdlib endIt raises an exception Finally (org, final) when finally cannot recover the error.
It raises an exception Finally (org, final) when finally cannot recover the error.
true at success
tee f v ~handler. If f v raises an exception e, handler e is executed, then e is reraised.
include module type of struct include Xlist.Stdlib endsame as from_to. [f--t = [f..t]]
include module type of struct include Xstring.Stdlib endinclude module type of struct include Xfilename.Stdlib endFilename concatenation. If the second argument is absolute, the first is ignored and the second is just returened.
"hello" ^/ "world" = "hello/world" "hello" ^/ "/world" = "/world"
include module type of struct include Xunix.Stdlib endtimed_message mes f returns a function as same as f but with printing computation times to stderr.