futhark-0.7.4: An optimising compiler for a functional, array-oriented language.

Safe HaskellNone
LanguageHaskell2010

Language.Futhark.TypeChecker.Types

Synopsis

Documentation

unifyTypesU :: (Monoid als, Eq als, ArrayDim dim) => (Uniqueness -> Uniqueness -> Maybe Uniqueness) -> TypeBase dim als -> TypeBase dim als -> Maybe (TypeBase dim als) Source #

unifyTypes uf t2 t2 attempts to unify t1 and t2. If unification cannot happen, Nothing is returned, otherwise a type that combines the aliasing of t1 and t2 is returned. Uniqueness is unified with uf.

subtypeOf :: ArrayDim dim => TypeBase dim as1 -> TypeBase dim as2 -> Bool Source #

x `subtypeOf` y is true if x is a subtype of y (or equal to y), meaning x is valid whenever y is.

subuniqueOf :: Uniqueness -> Uniqueness -> Bool Source #

x subuniqueOf y is true if x is not less unique than y.

checkForDuplicateNames :: MonadTypeChecker m => [UncheckedPattern] -> m () Source #

Check for duplication of names inside a pattern group. Produces a description of all names used in the pattern group.

data TypeSub Source #

Instances
Show TypeSub Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

class Substitutable a where Source #

Class of types which allow for substitution of types with no annotations for type variable names.

Methods

applySubst :: (VName -> Maybe (TypeBase () ())) -> a -> a Source #

substTypesAny :: (ArrayDim dim, Monoid as) => (VName -> Maybe (TypeBase dim as)) -> TypeBase dim as -> TypeBase dim as Source #

Perform substitutions, from type names to types, on a type. Works regardless of what shape and uniqueness information is attached to the type.