Module Util
This module contains numerous utility functions on strings, lists, arrays, etc.
val on_fst : ('a -> 'b) -> ('a * 'c) -> 'b * 'cval on_snd : ('a -> 'b) -> ('c * 'a) -> 'c * 'bval map_pair : ('a -> 'b) -> ('a * 'a) -> 'b * 'b
val fold_fst : ('c -> 'a -> 'c * 'a) -> 'c -> ('a * 'b) -> 'c * ('a * 'b)val fold_snd : ('c -> 'b -> 'c * 'b) -> 'c -> ('a * 'b) -> 'c * ('a * 'b)
val on_pi1 : ('a -> 'b) -> ('a * 'c * 'd) -> 'b * 'c * 'dval on_pi2 : ('a -> 'b) -> ('c * 'a * 'd) -> 'c * 'b * 'dval on_pi3 : ('a -> 'b) -> ('c * 'd * 'a) -> 'c * 'd * 'b
Projections from triplets
Chars.
Empty type
module Empty : sig ... endStrings.
module String = CStringLists.
Arrays.
module Array : CArray.ExtSSets.
Maps.
Matrices.
Functions.
Delayed computations.
val delayed_force : 'a delayed -> 'aval try_finally : ('a -> 'b) -> 'a -> ('c -> unit) -> 'c -> 'btry_finally f x g yapplies the main codeftoxand returns the result after having applied the finalization codegtoy. If the main code raises the exceptionexn, the finalization code is executed andexnis raised. If the finalization code itself fails, the exception returned is always the one from the finalization code. Credit X.Leroy, D.Remy.
Enriched exceptions
type iexn= Exninfo.iexn
val iraise : Exninfo.iexn -> 'a
Misc.
type ('a, 'b) union= ('a, 'b) CSig.union=|Inl of 'a|Inr of 'bUnion type
module Union : sig ... endtype 'a until= 'a CSig.until=|Stop of 'a|Cont of 'aUsed for browsable-until structures.
type ('a, 'b) eq= ('a, 'b) CSig.eq=|Refl : ('a, 'a) eq
module Compare : sig ... endHelpers to write comparison functions