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



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



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.