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

Language.Futhark.TypeChecker.Types

Synopsis

Documentation

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

unifyTypes uf t1 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.

typeParamToArg :: TypeParam -> StructTypeArg Source #

Construct a type argument corresponding to a type parameter.

data TypeSub Source #

Instances

Instances details
Show TypeSub Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

data Subst t Source #

A type substituion may be a substitution or a yet-unknown substitution (but which is certainly an overloaded primitive type!). The latter is used to remove aliases from types that are yet-unknown but that we know cannot carry aliases (see issue #682).

Constructors

Subst t 
PrimSubst 
SizeSubst (DimDecl VName) 

Instances

Instances details
Functor Subst Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Methods

fmap :: (a -> b) -> Subst a -> Subst b #

(<$) :: a -> Subst b -> Subst a #

Show t => Show (Subst t) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Methods

showsPrec :: Int -> Subst t -> ShowS #

show :: Subst t -> String #

showList :: [Subst t] -> ShowS #

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 (Subst StructType)) -> a -> a Source #

substTypesAny :: Monoid as => (VName -> Maybe (Subst (TypeBase (DimDecl VName) as))) -> TypeBase (DimDecl VName) as -> TypeBase (DimDecl VName) 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.