module Fun: Generic_util_fun
val const : 'a -> 'b -> 'a
val id : 'a -> 'a
val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c
The functions res_n
compose a unary function to
the result of a n
-ary function, so that:
res_n g f x_0 .. x_{n-1} == g (f x_0 ... x_{n-1})
val res0 : ('a -> 'b) -> 'a -> 'b
val res1 : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
val res2 : ('a -> 'b) -> ('c -> 'd -> 'a) -> 'c -> 'd -> 'b
val res3 : ('a -> 'b) -> ('c -> 'd -> 'e -> 'a) -> 'c -> 'd -> 'e -> 'b
val res4 : ('a -> 'b) -> ('c -> 'd -> 'e -> 'f -> 'a) -> 'c -> 'd -> 'e -> 'f -> 'b
val res5 : ('a -> 'b) ->
('c -> 'd -> 'e -> 'f -> 'g -> 'a) -> 'c -> 'd -> 'e -> 'f -> 'g -> 'b
val res6 : ('a -> 'b) ->
('c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'a) ->
'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'b
val res7 : ('a -> 'b) ->
('c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'a) ->
'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'b
val res8 : ('a -> 'b) ->
('c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'a) ->
'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'b
val res9 : ('a -> 'b) ->
('c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k -> 'a) ->
'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k -> 'b
val opres : ('a -> 'b -> 'c) -> ('d -> 'a) -> ('d -> 'b) -> 'd -> 'c
opres (^) f g x = f x ^ g x
val opon : ('a -> 'a -> 'b) -> ('c -> 'a) -> 'c -> 'c -> 'b
opon (^) f x y = f x ^ f y
val (-<) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
(g -< f) x = g (f x)
val (>-) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c
(f >- g) x = g (f x)
val (>>.) : ('a -> 'b) -> ('a -> 'c) -> 'a -> 'c
(f >>. g) x = f x ; g x
val (&&.) : ('a -> bool) -> ('a -> bool) -> 'a -> bool
(f &&. g) x = f x && g x
type ('a, 'b)
iso = {
|
fwd : |
|
bck : |
fwd (bck x) = bck (fwd x) = x
val iso_id : ('a, 'a) iso
val in_range : 'a -> 'a * 'a -> bool
in_range x (a, b) = x >= a && x <= b