Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Commodity module to build a simple query and extract the output from the solution found by Elpi.
Example: "foo data Output" where data
has type t
(a
is t Conversion.t
) and Output
has type v
(b
is a v Conversion.t
) can be described as: |
let q : (v * unit) t = Query {
predicate = "foo";
arguments = D(a, data,
Q(b, "Output",
N))
|
}
Then compile q
can be used to obtain the compiled query such that the resulting solution has a fied output of type (v * unit)
. Example: |
Query.compile q |> Compile.link |> Execute.once |> function
| Execute.Success { output
-> output | _ -> ...
|
}
type _ arguments =
| N : unit arguments
| D : 'a Conversion.t * 'a * 'x arguments -> 'x arguments
| Q : 'a Conversion.t * name * 'x arguments -> ('a * 'x) arguments
val compile : Compile.program -> Ast.Loc.t -> 'a t -> 'a Compile.query