Middleend.InferCopyright 2026, Mikhail Gavrilenko, Danila Rudnev-Stepanyan, Daniel Vlasenko
SPDX-License-Identifier: LGPL-3.0-or-later
val pprint_err : Stdlib.Format.formatter -> error -> unitval infer_exp :
(Common.Ast.ident * Common.Ast.TypeExpr.t) list ->
Common.Ast.Expression.t ->
((Common.Ast.ident * Common.Ast.TypeExpr.t) list * Common.Ast.TypeExpr.t,
error)
Stdlib.resultinfer_exp env exp infers type of the expression exp in the environment env and returns updated environment and type of exp
val infer_pat :
(Common.Ast.ident * Common.Ast.TypeExpr.t) list ->
Common.Ast.Pattern.t ->
((Common.Ast.ident * Common.Ast.TypeExpr.t) list * Common.Ast.TypeExpr.t,
error)
Stdlib.resultinfer_pat env pat infers type of the pattern pat in the environment env and returns updated environment and type of pat
val infer_structure_item :
(Common.Ast.ident * Common.Ast.TypeExpr.t) list ->
Common.Ast.Structure.structure_item ->
((Common.Ast.ident * Common.Ast.TypeExpr.t) list * Common.Ast.ident list,
error)
Stdlib.resultinfer_structure_item env item infers type of the item item in the environment env and returns updated environment and new names
val infer_program :
(Common.Ast.ident * Common.Ast.TypeExpr.t) list ->
Common.Ast.Structure.structure_item list ->
((Common.Ast.ident * Common.Ast.TypeExpr.t) list * Common.Ast.ident list,
error)
Stdlib.resultinfer_program env prog infers all types in program prog with initial environment env and returns updated environment and names of all new global identificators
for basic environment, use env_with_things
val env_with_things : (Common.Ast.ident * Common.Ast.TypeExpr.t) listenv_with_things is the basic environment that contains built-in functions and constructors