futhark
Safe HaskellNone
LanguageGHC2021

Language.Futhark.TypeChecker.TySolve

Synopsis

Documentation

type Type = CtType () Source #

The type representation used by the constraint solver. Agnostic to sizes and freshness.

type Solution = Map TyVar (Either [PrimType] (TypeBase () NoMode)) Source #

A solution maps a type variable to its substitution. This substitution is complete, in the sense there are no right-hand sides that contain a type variable.

type UnconTyVar = (VName, Liftedness) Source #

An unconstrained type variable comprises a name and (ironically) a constraint on how it can be instantiated.

solve :: [CtTy ()] -> TyParams -> TyVars () -> Either TypeError ([UnconTyVar], Solution) Source #

Solve type constraints, producing either an error or a solution, alongside a list of unconstrained type variables.