package ego

  1. Overview
  2. Docs

This module encodes syntactic rewrite rules over Sexprs and is part of Ego.Basic's API for expressing syntactic rewrites.

type t

Encodes a rewrite rule over S-expressions.

val pp : Stdlib.Format.formatter -> t -> unit

pp fmt r pretty prints the rewrite rule r.

val show : t -> string

show r converts the rewrite rule r to a string

val make : from:Query.t -> into:Query.t -> t option

make ~from ~into builds a syntactic rewrite rule from a matching pattern from and a result pattern into.

Iff into contains variables that are not bound in from, then the rule is invalid, and the function will return None.