-
Notifications
You must be signed in to change notification settings - Fork 0
/
ppx_static.opam
35 lines (30 loc) · 1.18 KB
/
ppx_static.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
opam-version: "2.0"
maintainer: "Petter A. Urkedal <paurkedal@gmail.com>"
authors: "Petter A. Urkedal <paurkedal@gmail.com>"
license: "LGPL-3 with OCaml linking exception"
homepage: "https://github.com/paurkedalt/ppx_static"
bug-reports: "https://github.com/paurkedalt/ppx_static/issues"
depends: [
"ocaml" {>= "4.02.3"}
"dune" {>= "2.8" & build}
"ppxlib"
]
build: ["jbuilder" "build" "--root" "." "-j" jobs "@install"]
dev-repo: "git+https://github.com/paurkedalt/ppx_static.git"
synopsis: "A PPX rewriter to lift expressions out of a local scope"
description: """
This is a simple syntax extension to lift the computation of a value out of
any surrounding abstractions. This allows expressing anonymous constants
close to where they are used, without the penalty of recomputing them on
each function invocation or module application. A secondary use is to add
state deep within a function, which persists across invocations.
As an example,
module Geometry = struct
let to_degrees x = x *. [%static 360.0 /. (8.0 *. atan 1.0)]
end
is translated to
let __ppx_static_1234 = 360.0 /. (8.0 *. atan 1.0) in
module Geometry = struct
let to_degrees x = x *. __ppx_static_1234
end
"""