Module Kxclib.Functionals

val negate : ('a -> bool) -> 'b -> bool

negate a predicate

val both : ('a -> bool) -> ('b -> bool) -> 'c -> bool
val either : ('a -> bool) -> ('b -> bool) -> 'c -> bool
val dig2nd : ('a -> 'b -> 'c) -> 'd -> 'e -> 'f

f dig the second argument of f to be the first. aka flip

val dig3rd : ('a -> 'b -> 'c -> 'd) -> 'e -> 'f -> 'g -> 'h

f dig the third argument of f to be the first

val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c

f flip the first arguments of f. aka dig2nd

val fix1st : 'a -> ('b -> 'c) -> 'd

x f fix the first argument to f as x

val fix2nd : 'a -> ('b -> 'c -> 'd) -> 'e -> 'f

y f fix the second argument to f as y

val fix3rd : 'a -> ('b -> 'c -> 'd -> 'e) -> 'f -> 'g -> 'h

z f fix the third argument to f as z

val fix1st' : 'a -> ('b -> 'c) -> 'd -> 'e

x f fix the first argument to f as x, but still accept (and ignore) the fixed argument

val tap : ('a -> unit) -> 'b -> 'c
val reptill : ('a -> bool) -> ('b -> 'c) -> 'd -> 'e

reptill judge f x evaluates f x repeatedly till judge (f x) holds.

val ntimes : int -> ('a -> 'b) -> 'c -> 'd

ntimes n f x applies f ntimes to x.

val dotill : ('a -> bool) -> ('b -> 'c) -> 'd -> 'e

dotill judge f x applies f to x repeatedly till judge x holds.

val fixpoint : ?maxn:int -> ('a -> 'b) -> 'c -> 'd

fixpoint f try to resolve the fixpoint of f. maxn, an optional argument, limits the number of iterations to find the fix point.

val converge' : (int -> 'a -> 'b -> bool) -> ('c -> 'd) -> 'e -> ('f, 'g) Stdlib.result
val converge : ('a -> 'b -> bool) -> ('c -> 'c) -> 'd -> ('c, 'e) Stdlib.result
module BasicInfix : sig ... end
module CommonTypes : sig ... end
module Infix = BasicInfix