-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathppx_compose.opam
46 lines (38 loc) · 1.57 KB
/
ppx_compose.opam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
opam-version: "2.0"
name: "ppx_compose"
maintainer: "Petter A. Urkedal <[email protected]>"
authors: "Petter A. Urkedal <[email protected]>"
license: "LGPL-3.0-or-later WITH LGPL-3.0-linking-exception"
homepage: "https://github.com/paurkedal/ppx_compose"
bug-reports: "https://github.com/paurkedal/ppx_compose/issues"
depends: [
"ocaml" {>= "4.04.2"}
"dune" {>= "1.1"}
"ppxlib"
]
build: [
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
dev-repo: "git+https://github.com/paurkedal/ppx_compose.git"
synopsis: "Inlined function composition"
description: """
`ppx_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:
* A composition occurring to the left of an application is reduced by
applying each term of the composition from right to left to the
argument, ignoring associative variations.
* A composition which is not the left side of an application is first
turned into one by η-expansion, then the above rule applies.
* Any partially applied composition operators are passed though unchanged.
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)))
"""