Module Generic.Query
The module Query
encodes generic patterns (for both matching and transformation) over expressions and is part of Ego.Generic
's API for expressing rewrites.
val of_sexp : (string -> 'a) -> Sexplib0.Sexp.t -> 'a t
of_sexp f s
constructs a query from a sexpressions
usingf
to convert operator tags.
val to_sexp : ('a -> string) -> 'a t -> Sexplib0.Sexp.t
to_sexp f q
converts a queryq
to a sexpression usingf
to convert operators in the query to strings.
val pp : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a t -> unit
pp f fmt q
pretty prints a queryq
usingf
to print the operators within the query.
val show : (Stdlib.Format.formatter -> 'a -> unit) -> 'a t -> string
show f q
prints a queryq
to string usingf
to print operators within the query.