Module Middle.Stmt

MIR types and modules corresponding to the statements of the language

module Pattern : sig ... end
type ('a, 'b) t = {
  1. pattern : ('a Expr.t, ('a, 'b) t) Pattern.t;
  2. meta : 'b;
}

The "two-level" type for statements in the MIR. This corresponds to what the AST calls Frontend.Ast.statement_with

val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> ('b -> Sexplib0.Sexp.t) -> ('a, 'b) t -> Sexplib0.Sexp.t
val pp : ('a, 'b) t Fmt.t
val rewrite_bottom_up : f:('a Expr.t -> 'a Expr.t) -> g:(('a, 'b) t -> ('a, 'b) t) -> ('a, 'b) t -> ('a, 'b) t

rewrite_bottom_up specializes fold so that the result type 'r1 is equal to the type of the nested fixed-point type i.e. 'r1 = 'a Expr.t and the result type 'r2 is equal to the top-level fixed-point type i.e. 'r2 = ('a,'b) t.

This also means that the function f can be written with our nested fixed-point type 'a Expr.t as its argument and g can be written with ('a,'b) t as its argument.

module Located : sig ... end
module Numbered : sig ... end
module Helpers : sig ... end