Module Base.Fn
Various combinators for functions.
val ignore : _ -> unit
ignore
is the same asCaml.ignore
. It is useful to have here so that code that rebindsignore
can still refer toFn.ignore
.
val forever : (unit -> unit) -> exn
forever f
runsf ()
until it throws an exception and returns the exception. This function is useful for read_line loops, etc.
val apply_n_times : n:int -> ('a -> 'a) -> 'a -> 'a
apply_n_times ~n f x
is then
-fold application off
tox
.
val id : 'a -> 'a
The identity function.
See also:
Sys.opaque_identity
.