diff options
Diffstat (limited to 'lib/util.ml')
-rw-r--r-- | lib/util.ml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/util.ml b/lib/util.ml index b67539918..0f79c10df 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -87,7 +87,13 @@ let matrix_transpose mat = let identity x = x -let compose f g x = f (g x) +(** Function composition: the mathematical [∘] operator. + + So [g % f] is a synonym for [fun x -> g (f x)]. + + Also because [%] is right-associative, [h % g % f] means [fun x -> h (g (f x))]. + *) +let (%) f g x = f (g x) let const x _ = x |