futhark-0.16.1: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe
LanguageHaskell2010

Language.Futhark.TypeChecker.Modules

Description

Implementation of the Futhark module system (at least most of it; some is scattered elsewhere in the type checker).

Synopsis

Documentation

matchMTys :: MTy -> MTy -> SrcLoc -> Either TypeError (Map VName VName) Source #

Return new renamed/abstracted env, as well as a mapping from names in the signature to names in the new env. This is used for functor application. The first env is the module env, and the second the env it must match.

newNamesForMTy :: MTy -> TypeM (MTy, Map VName VName) Source #

Create unique renames for the module type. This is used for e.g. generative functor application.

refineEnv :: SrcLoc -> TySet -> Env -> QualName Name -> [TypeParam] -> StructType -> TypeM (QualName VName, TySet, Env) Source #

Refine the given type name in the given env.

applyFunctor :: SrcLoc -> FunSig -> MTy -> TypeM (MTy, Map VName VName, Map VName VName) Source #

Apply a parametric module to an argument.