module Function:Common functions and combinators.sig
..end
val identity : 'a -> 'a
val constant : 'a -> 'b -> 'a
val compose : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c
val until : ('a -> bool) -> ('a -> 'a) -> 'a -> 'a
until p f x
applies f
repeatedly, starting with x
,
until the predicate p
evaluates to true
.
Note: If p x
is true
then x
is returned.
val fix : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b