giml-transform-0.1.0.0: Typing and transformations for Giml
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Giml.Types.Infer

Description

Type inference

Our type inference algorithm works in stages:

First, we elaborate the AST and collect constraints. Then, we solve these constraints and get back a substitution. We go over the AST again, replacing the type variables we added in the elaboration stage with concrete types.

The constraints of each group of definitions are solved separately and in order.

Synopsis

Documentation

data ElabState Source #

The state we keep during elaboration.

Constructors

ElabState 

Fields

infer :: MonadBase b b => LogAction b LogMsg -> File InputAnn -> ExceptT TypeErrorA b (File Ann) Source #

Infer the types for all expressions in a source file