Skip to content

Commit 46e19ef

Browse files
committed
[elpi] break long lines
1 parent b5dfa18 commit 46e19ef

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/core/ctxt.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ open Timed
99
extension of context [ctx] with the assumption that [x] has type [a] (only
1010
if [x] occurs in [t]). If [def] is of the form [Some(u)], the context also
1111
registers the term [u] as the definition of variable [x]. *)
12-
let unbind : 'a actxt -> 'a -> term option -> tbinder -> tvar * term * 'a actxt =
12+
let unbind : 'a actxt -> 'a -> term option -> tbinder ->
13+
tvar * term * 'a actxt =
1314
fun ctx a def b ->
1415
let (x, t) = Bindlib.unbind b in
1516
(x, t, if Bindlib.binder_occur b then (x, a, def) :: ctx else ctx)

src/core/elpi_lambdapi.ml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ let embed_term : Terms.term Conversion.embedding = fun ~depth st t ->
5050
let open RawData in
5151
let open Terms in
5252
let gls = ref [] in
53-
let call f ~depth s x = let s, x, g = f ~depth s x in gls := g @ !gls; s, x in
53+
let call f ~depth s x =
54+
let s, x, g = f ~depth s x in gls := g @ !gls; s, x in
5455
let rec aux ~depth ctx st t =
5556
match Terms.unfold t with
5657
| Vari v ->
@@ -92,11 +93,13 @@ let embed_term : Terms.term Conversion.embedding = fun ~depth st t ->
9293
let st, t = aux ~depth [] st t in
9394
st, t, List.rev !gls
9495

95-
let readback_term_box : Terms.term Bindlib.box Conversion.readback = fun ~depth st t ->
96+
let readback_term_box : Terms.term Bindlib.box Conversion.readback =
97+
fun ~depth st t ->
9698
let open RawData in
9799
let open Terms in
98100
let gls = ref [] in
99-
let call f ~depth s x = let s, x, g = f ~depth s x in gls := g @ !gls; s, x in
101+
let call f ~depth s x =
102+
let s, x, g = f ~depth s x in gls := g @ !gls; s, x in
100103
let rec aux ~depth ctx st t =
101104
match look ~depth t with
102105
| Const c when c == typec -> st, _Type
@@ -172,7 +175,8 @@ let readback_mbinder st t =
172175
| Lam bo -> aux ~depth:(depth+1) (nvars+1) bo
173176
| _ ->
174177
let open Bindlib in
175-
let vs = Array.init nvars (fun i -> new_var Terms.mkfree (Printf.sprintf "x%d" i)) in
178+
let vs = Array.init nvars (fun i ->
179+
new_var Terms.mkfree (Printf.sprintf "x%d" i)) in
176180
let st, t, _ = readback_term_box ~depth st t in
177181
st, unbox (bind_mvar vs t)
178182
in
@@ -256,11 +260,14 @@ fun ss file predicate arg ->
256260
let arg = Scope.scope_term Public ss Env.empty arg in
257261
let elpi = match !elpi with None -> assert false | Some x -> x in
258262
let ast = Parse.program ~elpi [file] in
259-
let prog = Elpi.API.Compile.program ~flags:Elpi.API.Compile.default_flags ~elpi [ast] in
263+
let prog =
264+
Elpi.API.Compile.program
265+
~flags:Elpi.API.Compile.default_flags ~elpi [ast] in
260266
let loc = loc_of_pos pos in
261267
let arguments = Query.(D(term,arg,N)) in
262268
let query = Query.(compile prog loc (Query { predicate; arguments })) in
263-
if not (Elpi.API.Compile.static_check ~checker:(Elpi.Builtin.default_checker ()) query) then
269+
if not (Elpi.API.Compile.static_check
270+
~checker:(Elpi.Builtin.default_checker ()) query) then
264271
Console.fatal pos "elpi: type error";
265272
let exe = Elpi.API.Compile.optimize query in
266273
Format.printf "\nelpi: before: %a\n" Print.pp_term arg;

0 commit comments

Comments
 (0)