ppx_compose - Inlined Function Compositionppx_compose is a simple syntax extension which rewrites code containing function compositions into composition-free code, effectively inlining the composition operators. The following two operators are supported
let (%) g f x = g (f x)
let (%>) f g x = g (f x)Corresponding definitions are not provided, so partial applications of (%) and (%>) will be undefined unless you provide the definitions.
The following rewrites are done:
E.g.
h % g % f ==> (fun x -> h (f (g x)))
h % (g % f) ==> (fun x -> h (f (g x)))
(g % f) (h % h) ==> g (f (fun x -> h (h x)))Recent flambda-enabled compilers can inline the following alternative definitions of the composition operators [1]:
let (%) g f = (); fun x -> g (f x)
let (%>) f g = (); fun x -> g (f x)so this syntax extension will likely be retired at some point.