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

Language.Futhark.Syntax

Description

The Futhark source language AST definition. Many types, such as ExpBase, are parametrised by type and name representation. E.g. in a value of type ExpBase f vn, annotations are wrapped in the functor f, and all names are of type vn. See https://futhark.readthedocs.org for a language reference, or this module may be a little hard to understand.

The system of primitive types is interesting in itself. See Language.Futhark.Primitive.

Synopsis

Documentation

pretty :: Pretty a => a -> String Source #

Prettyprint a value, wrapped to 80 characters.

prettyText :: Pretty a => a -> Text Source #

Prettyprint a value to a Text, wrapped to 80 characters.

Types

data Uniqueness Source #

The uniqueness attribute of a type. This essentially indicates whether or not in-place modifications are acceptable. With respect to ordering, Unique is greater than Nonunique.

Constructors

Nonunique

May have references outside current function.

Unique

No references outside current function.

Instances

Instances details
Monoid Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Semigroup Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Show Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

DeclExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

DeclTyped DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Typed DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: DeclType -> Type Source #

IsRetType FunReturns Source # 
Instance details

Defined in Futhark.IR.Mem

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

Eq Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Ord Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Pretty Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Simplifiable [FunReturns] Source # 
Instance details

Defined in Futhark.IR.Mem

FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

DeclTyped (MemInfo SubExp Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

Typed (MemInfo SubExp Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

data IntType Source #

An integer type, ordered by size. Note that signedness is not a property of the type, but a property of the operations performed on values of these types.

Constructors

Int8 
Int16 
Int32 
Int64 

Instances

Instances details
Bounded IntType Source # 
Instance details

Defined in Language.Futhark.Primitive

Enum IntType Source # 
Instance details

Defined in Language.Futhark.Primitive

Show IntType Source # 
Instance details

Defined in Language.Futhark.Primitive

Eq IntType Source # 
Instance details

Defined in Language.Futhark.Primitive

Methods

(==) :: IntType -> IntType -> Bool #

(/=) :: IntType -> IntType -> Bool #

Ord IntType Source # 
Instance details

Defined in Language.Futhark.Primitive

Pretty IntType Source # 
Instance details

Defined in Language.Futhark.Primitive

Methods

ppr :: IntType -> Doc #

pprPrec :: Int -> IntType -> Doc #

pprList :: [IntType] -> Doc #

data FloatType Source #

A floating point type.

Constructors

Float16 
Float32 
Float64 

Instances

Instances details
Bounded FloatType Source # 
Instance details

Defined in Language.Futhark.Primitive

Enum FloatType Source # 
Instance details

Defined in Language.Futhark.Primitive

Show FloatType Source # 
Instance details

Defined in Language.Futhark.Primitive

Eq FloatType Source # 
Instance details

Defined in Language.Futhark.Primitive

Ord FloatType Source # 
Instance details

Defined in Language.Futhark.Primitive

Pretty FloatType Source # 
Instance details

Defined in Language.Futhark.Primitive

Methods

ppr :: FloatType -> Doc #

pprPrec :: Int -> FloatType -> Doc #

pprList :: [FloatType] -> Doc #

data PrimType Source #

Low-level primitive types.

Instances

Instances details
Show PrimType Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq PrimType Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord PrimType Source # 
Instance details

Defined in Language.Futhark.Syntax

Pretty PrimType Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

ppr :: PrimType -> Doc #

pprPrec :: Int -> PrimType -> Doc #

pprList :: [PrimType] -> Doc #

data Size Source #

The elaborated size of a dimension.

Constructors

NamedSize (QualName VName)

The size of the dimension is this name, which must be in scope. In a return type, this will give rise to an assertion.

ConstSize Int

The size is a constant.

AnySize (Maybe VName)

No known size. If Nothing, then this is a name distinct from any other. The type checker should _never_ produce these - they are a (hopefully temporary) thing introduced by defunctorisation and monomorphisation.

Instances

Instances details
Show Size Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> Size -> ShowS #

show :: Size -> String #

showList :: [Size] -> ShowS #

ASTMappable PatRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable PatType Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> PatType -> m PatType Source #

ASTMappable Size Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> Size -> m Size Source #

ASTMappable StructRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable StructType Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable Size Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Eq Size Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: Size -> Size -> Bool #

(/=) :: Size -> Size -> Bool #

Ord Size Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: Size -> Size -> Ordering #

(<) :: Size -> Size -> Bool #

(<=) :: Size -> Size -> Bool #

(>) :: Size -> Size -> Bool #

(>=) :: Size -> Size -> Bool #

max :: Size -> Size -> Size #

min :: Size -> Size -> Size #

Pretty Size Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: Size -> Doc #

pprPrec :: Int -> Size -> Doc #

pprList :: [Size] -> Doc #

Pretty (Shape Size) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: Shape Size -> Doc #

pprPrec :: Int -> Shape Size -> Doc #

pprList :: [Shape Size] -> Doc #

Substitutable (RetTypeBase Size Aliasing) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (RetTypeBase Size ()) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (TypeBase Size Aliasing) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (TypeBase Size ()) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

newtype Shape dim Source #

The size of an array type is a list of its dimension sizes. If Nothing, that dimension is of a (statically) unknown size.

Constructors

Shape 

Fields

Instances

Instances details
Foldable Shape Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => Shape m -> m #

foldMap :: Monoid m => (a -> m) -> Shape a -> m #

foldMap' :: Monoid m => (a -> m) -> Shape a -> m #

foldr :: (a -> b -> b) -> b -> Shape a -> b #

foldr' :: (a -> b -> b) -> b -> Shape a -> b #

foldl :: (b -> a -> b) -> b -> Shape a -> b #

foldl' :: (b -> a -> b) -> b -> Shape a -> b #

foldr1 :: (a -> a -> a) -> Shape a -> a #

foldl1 :: (a -> a -> a) -> Shape a -> a #

toList :: Shape a -> [a] #

null :: Shape a -> Bool #

length :: Shape a -> Int #

elem :: Eq a => a -> Shape a -> Bool #

maximum :: Ord a => Shape a -> a #

minimum :: Ord a => Shape a -> a #

sum :: Num a => Shape a -> a #

product :: Num a => Shape a -> a #

Traversable Shape Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Shape a -> f (Shape b) #

sequenceA :: Applicative f => Shape (f a) -> f (Shape a) #

mapM :: Monad m => (a -> m b) -> Shape a -> m (Shape b) #

sequence :: Monad m => Shape (m a) -> m (Shape a) #

Functor Shape Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Monoid (Shape dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

mempty :: Shape dim #

mappend :: Shape dim -> Shape dim -> Shape dim #

mconcat :: [Shape dim] -> Shape dim #

Semigroup (Shape dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(<>) :: Shape dim -> Shape dim -> Shape dim #

sconcat :: NonEmpty (Shape dim) -> Shape dim #

stimes :: Integral b => b -> Shape dim -> Shape dim #

Show dim => Show (Shape dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> Shape dim -> ShowS #

show :: Shape dim -> String #

showList :: [Shape dim] -> ShowS #

Substitutable d => Substitutable (Shape d) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Methods

applySubst :: TypeSubs -> Shape d -> Shape d Source #

Eq dim => Eq (Shape dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: Shape dim -> Shape dim -> Bool #

(/=) :: Shape dim -> Shape dim -> Bool #

Ord dim => Ord (Shape dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: Shape dim -> Shape dim -> Ordering #

(<) :: Shape dim -> Shape dim -> Bool #

(<=) :: Shape dim -> Shape dim -> Bool #

(>) :: Shape dim -> Shape dim -> Bool #

(>=) :: Shape dim -> Shape dim -> Bool #

max :: Shape dim -> Shape dim -> Shape dim #

min :: Shape dim -> Shape dim -> Shape dim #

Pretty (Shape Int64) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: Shape Int64 -> Doc #

pprPrec :: Int -> Shape Int64 -> Doc #

pprList :: [Shape Int64] -> Doc #

Pretty (Shape Size) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: Shape Size -> Doc #

pprPrec :: Int -> Shape Size -> Doc #

pprList :: [Shape Size] -> Doc #

Pretty (Shape ()) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: Shape () -> Doc #

pprPrec :: Int -> Shape () -> Doc #

pprList :: [Shape ()] -> Doc #

Pretty (Shape Bool) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: Shape Bool -> Doc #

pprPrec :: Int -> Shape Bool -> Doc #

pprList :: [Shape Bool] -> Doc #

shapeRank :: Shape dim -> Int Source #

The number of dimensions contained in a shape.

stripDims :: Int -> Shape dim -> Maybe (Shape dim) Source #

stripDims n shape strips the outer n dimensions from shape, returning Nothing if this would result in zero or fewer dimensions.

data TypeBase dim as Source #

An expanded Futhark type is either an array, or something that can be an element of an array. When comparing types for equality, function parameter names are ignored. This representation permits some malformed types (arrays of functions), but importantly rules out arrays-of-arrays.

Constructors

Scalar (ScalarTypeBase dim as) 
Array as Uniqueness (Shape dim) (ScalarTypeBase dim ()) 

Instances

Instances details
Bifoldable TypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bifold :: Monoid m => TypeBase m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> TypeBase a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> TypeBase a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> TypeBase a b -> c #

Bifunctor TypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bimap :: (a -> b) -> (c -> d) -> TypeBase a c -> TypeBase b d #

first :: (a -> b) -> TypeBase a c -> TypeBase b c #

second :: (b -> c) -> TypeBase a b -> TypeBase a c #

Bitraversable TypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> TypeBase a b -> f (TypeBase c d) #

ASTMappable PatType Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> PatType -> m PatType Source #

ASTMappable StructType Source # 
Instance details

Defined in Language.Futhark.Traversals

(Show as, Show dim) => Show (TypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> TypeBase dim as -> ShowS #

show :: TypeBase dim as -> String #

showList :: [TypeBase dim as] -> ShowS #

Substitutable (TypeBase Size Aliasing) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (TypeBase Size ()) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

(Eq as, Eq dim) => Eq (TypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: TypeBase dim as -> TypeBase dim as -> Bool #

(/=) :: TypeBase dim as -> TypeBase dim as -> Bool #

(Ord as, Ord dim) => Ord (TypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: TypeBase dim as -> TypeBase dim as -> Ordering #

(<) :: TypeBase dim as -> TypeBase dim as -> Bool #

(<=) :: TypeBase dim as -> TypeBase dim as -> Bool #

(>) :: TypeBase dim as -> TypeBase dim as -> Bool #

(>=) :: TypeBase dim as -> TypeBase dim as -> Bool #

max :: TypeBase dim as -> TypeBase dim as -> TypeBase dim as #

min :: TypeBase dim as -> TypeBase dim as -> TypeBase dim as #

Pretty (Shape dim) => Pretty (TypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: TypeBase dim as -> Doc #

pprPrec :: Int -> TypeBase dim as -> Doc #

pprList :: [TypeBase dim as] -> Doc #

data TypeArg dim Source #

An argument passed to a type constructor.

Constructors

TypeArgDim dim SrcLoc 
TypeArgType (TypeBase dim ()) SrcLoc 

Instances

Instances details
Foldable TypeArg Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => TypeArg m -> m #

foldMap :: Monoid m => (a -> m) -> TypeArg a -> m #

foldMap' :: Monoid m => (a -> m) -> TypeArg a -> m #

foldr :: (a -> b -> b) -> b -> TypeArg a -> b #

foldr' :: (a -> b -> b) -> b -> TypeArg a -> b #

foldl :: (b -> a -> b) -> b -> TypeArg a -> b #

foldl' :: (b -> a -> b) -> b -> TypeArg a -> b #

foldr1 :: (a -> a -> a) -> TypeArg a -> a #

foldl1 :: (a -> a -> a) -> TypeArg a -> a #

toList :: TypeArg a -> [a] #

null :: TypeArg a -> Bool #

length :: TypeArg a -> Int #

elem :: Eq a => a -> TypeArg a -> Bool #

maximum :: Ord a => TypeArg a -> a #

minimum :: Ord a => TypeArg a -> a #

sum :: Num a => TypeArg a -> a #

product :: Num a => TypeArg a -> a #

Traversable TypeArg Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> TypeArg a -> f (TypeArg b) #

sequenceA :: Applicative f => TypeArg (f a) -> f (TypeArg a) #

mapM :: Monad m => (a -> m b) -> TypeArg a -> m (TypeArg b) #

sequence :: Monad m => TypeArg (m a) -> m (TypeArg a) #

Functor TypeArg Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Show dim => Show (TypeArg dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> TypeArg dim -> ShowS #

show :: TypeArg dim -> String #

showList :: [TypeArg dim] -> ShowS #

Eq dim => Eq (TypeArg dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: TypeArg dim -> TypeArg dim -> Bool #

(/=) :: TypeArg dim -> TypeArg dim -> Bool #

Ord dim => Ord (TypeArg dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: TypeArg dim -> TypeArg dim -> Ordering #

(<) :: TypeArg dim -> TypeArg dim -> Bool #

(<=) :: TypeArg dim -> TypeArg dim -> Bool #

(>) :: TypeArg dim -> TypeArg dim -> Bool #

(>=) :: TypeArg dim -> TypeArg dim -> Bool #

max :: TypeArg dim -> TypeArg dim -> TypeArg dim #

min :: TypeArg dim -> TypeArg dim -> TypeArg dim #

Pretty (Shape dim) => Pretty (TypeArg dim) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: TypeArg dim -> Doc #

pprPrec :: Int -> TypeArg dim -> Doc #

pprList :: [TypeArg dim] -> Doc #

data SizeExp vn Source #

A size expression for use in a TypeExp.

Constructors

SizeExpNamed (QualName vn) SrcLoc

The size of the dimension is this name, which must be in scope.

SizeExpConst Int SrcLoc

The size is a constant.

SizeExpAny

No dimension declaration.

Instances

Instances details
Show vn => Show (SizeExp vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> SizeExp vn -> ShowS #

show :: SizeExp vn -> String #

showList :: [SizeExp vn] -> ShowS #

ASTMappable (SizeExp VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> SizeExp VName -> m (SizeExp VName) Source #

Eq (SizeExp Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (SizeExp VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (SizeExp Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (SizeExp VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

IsName vn => Pretty (SizeExp vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: SizeExp vn -> Doc #

pprPrec :: Int -> SizeExp vn -> Doc #

pprList :: [SizeExp vn] -> Doc #

data TypeExp vn Source #

An unstructured type with type variables and possibly shape declarations - this is what the user types in the source program. These are used to construct TypeBases in the type checker.

Instances

Instances details
Show vn => Show (TypeExp vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> TypeExp vn -> ShowS #

show :: TypeExp vn -> String #

showList :: [TypeExp vn] -> ShowS #

ASTMappable (TypeExp VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> TypeExp VName -> m (TypeExp VName) Source #

Eq (TypeExp Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (TypeExp VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (TypeExp Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (TypeExp VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn) => Pretty (TypeExp vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: TypeExp vn -> Doc #

pprPrec :: Int -> TypeExp vn -> Doc #

pprList :: [TypeExp vn] -> Doc #

Located (TypeExp vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: TypeExp vn -> Loc #

locOfList :: [TypeExp vn] -> Loc #

data TypeArgExp vn Source #

A type argument expression passed to a type constructor.

Instances

Instances details
Show vn => Show (TypeArgExp vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> TypeArgExp vn -> ShowS #

show :: TypeArgExp vn -> String #

showList :: [TypeArgExp vn] -> ShowS #

ASTMappable (TypeArgExp VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (TypeArgExp Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (TypeArgExp VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (TypeArgExp Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (TypeArgExp VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn) => Pretty (TypeArgExp vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: TypeArgExp vn -> Doc #

pprPrec :: Int -> TypeArgExp vn -> Doc #

pprList :: [TypeArgExp vn] -> Doc #

Located (TypeArgExp vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: TypeArgExp vn -> Loc #

locOfList :: [TypeArgExp vn] -> Loc #

data PName Source #

The name (if any) of a function parameter. The Eq and Ord instances always compare values of this type equal.

Constructors

Named VName 
Unnamed 

Instances

Instances details
Show PName Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> PName -> ShowS #

show :: PName -> String #

showList :: [PName] -> ShowS #

Eq PName Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: PName -> PName -> Bool #

(/=) :: PName -> PName -> Bool #

Ord PName Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: PName -> PName -> Ordering #

(<) :: PName -> PName -> Bool #

(<=) :: PName -> PName -> Bool #

(>) :: PName -> PName -> Bool #

(>=) :: PName -> PName -> Bool #

max :: PName -> PName -> PName #

min :: PName -> PName -> PName #

data ScalarTypeBase dim as Source #

Types that can be elements of arrays. This representation does allow arrays of records of functions, which is nonsensical, but it convolutes the code too much if we try to statically rule it out.

Constructors

Prim PrimType 
TypeVar as Uniqueness (QualName VName) [TypeArg dim] 
Record (Map Name (TypeBase dim as)) 
Sum (Map Name [TypeBase dim as]) 
Arrow as PName (TypeBase dim ()) (RetTypeBase dim as)

The aliasing corresponds to the lexical closure of the function.

Instances

Instances details
Bifoldable ScalarTypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bifold :: Monoid m => ScalarTypeBase m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> ScalarTypeBase a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> ScalarTypeBase a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> ScalarTypeBase a b -> c #

Bifunctor ScalarTypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bimap :: (a -> b) -> (c -> d) -> ScalarTypeBase a c -> ScalarTypeBase b d #

first :: (a -> b) -> ScalarTypeBase a c -> ScalarTypeBase b c #

second :: (b -> c) -> ScalarTypeBase a b -> ScalarTypeBase a c #

Bitraversable ScalarTypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> ScalarTypeBase a b -> f (ScalarTypeBase c d) #

(Show as, Show dim) => Show (ScalarTypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> ScalarTypeBase dim as -> ShowS #

show :: ScalarTypeBase dim as -> String #

showList :: [ScalarTypeBase dim as] -> ShowS #

(Eq as, Eq dim) => Eq (ScalarTypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> Bool #

(/=) :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> Bool #

(Ord as, Ord dim) => Ord (ScalarTypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> Ordering #

(<) :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> Bool #

(<=) :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> Bool #

(>) :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> Bool #

(>=) :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> Bool #

max :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> ScalarTypeBase dim as #

min :: ScalarTypeBase dim as -> ScalarTypeBase dim as -> ScalarTypeBase dim as #

Pretty (Shape dim) => Pretty (ScalarTypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: ScalarTypeBase dim as -> Doc #

pprPrec :: Int -> ScalarTypeBase dim as -> Doc #

pprList :: [ScalarTypeBase dim as] -> Doc #

data RetTypeBase dim as Source #

Types that can appear to the right of a function arrow. This just means they can be existentially quantified.

Constructors

RetType 

Fields

Instances

Instances details
Bifoldable RetTypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bifold :: Monoid m => RetTypeBase m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> RetTypeBase a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> RetTypeBase a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> RetTypeBase a b -> c #

Bifunctor RetTypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bimap :: (a -> b) -> (c -> d) -> RetTypeBase a c -> RetTypeBase b d #

first :: (a -> b) -> RetTypeBase a c -> RetTypeBase b c #

second :: (b -> c) -> RetTypeBase a b -> RetTypeBase a c #

Bitraversable RetTypeBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> RetTypeBase a b -> f (RetTypeBase c d) #

ASTMappable PatRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable StructRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

(Show as, Show dim) => Show (RetTypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> RetTypeBase dim as -> ShowS #

show :: RetTypeBase dim as -> String #

showList :: [RetTypeBase dim as] -> ShowS #

Substitutable (RetTypeBase Size Aliasing) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (RetTypeBase Size ()) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

(Eq as, Eq dim) => Eq (RetTypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: RetTypeBase dim as -> RetTypeBase dim as -> Bool #

(/=) :: RetTypeBase dim as -> RetTypeBase dim as -> Bool #

(Ord as, Ord dim) => Ord (RetTypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: RetTypeBase dim as -> RetTypeBase dim as -> Ordering #

(<) :: RetTypeBase dim as -> RetTypeBase dim as -> Bool #

(<=) :: RetTypeBase dim as -> RetTypeBase dim as -> Bool #

(>) :: RetTypeBase dim as -> RetTypeBase dim as -> Bool #

(>=) :: RetTypeBase dim as -> RetTypeBase dim as -> Bool #

max :: RetTypeBase dim as -> RetTypeBase dim as -> RetTypeBase dim as #

min :: RetTypeBase dim as -> RetTypeBase dim as -> RetTypeBase dim as #

Pretty (Shape dim) => Pretty (RetTypeBase dim as) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: RetTypeBase dim as -> Doc #

pprPrec :: Int -> RetTypeBase dim as -> Doc #

pprList :: [RetTypeBase dim as] -> Doc #

type PatType = TypeBase Size Aliasing Source #

A type with aliasing information and shape annotations, used for describing the type patterns and expressions.

type StructType = TypeBase Size () Source #

A "structural" type with shape annotations and no aliasing information, used for declarations.

type StructRetType = RetTypeBase Size () Source #

The return type version of StructType.

type PatRetType = RetTypeBase Size Aliasing Source #

The return type version of PatType.

type ValueType = TypeBase Int64 () Source #

A value type contains full, manifest size information.

data Diet Source #

Information about which parts of a value/type are consumed.

Constructors

RecordDiet (Map Name Diet)

Consumes these fields in the record.

SumDiet (Map Name [Diet])

Consume these parts of the constructors.

FuncDiet Diet Diet

A function that consumes its argument(s) like this. The final Diet should always be Observe, as there is no way for a function to consume its return value.

Consume

Consumes this value.

Observe

Only observes value in this position, does not consume.

Instances

Instances details
Show Diet Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> Diet -> ShowS #

show :: Diet -> String #

showList :: [Diet] -> ShowS #

Eq Diet Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: Diet -> Diet -> Bool #

(/=) :: Diet -> Diet -> Bool #

Ord Diet Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: Diet -> Diet -> Ordering #

(<) :: Diet -> Diet -> Bool #

(<=) :: Diet -> Diet -> Bool #

(>) :: Diet -> Diet -> Bool #

(>=) :: Diet -> Diet -> Bool #

max :: Diet -> Diet -> Diet #

min :: Diet -> Diet -> Diet #

Values

data IntValue Source #

An integer value.

Instances

Instances details
Show IntValue Source # 
Instance details

Defined in Language.Futhark.Primitive

IsValue IntValue Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

Eq IntValue Source # 
Instance details

Defined in Language.Futhark.Primitive

Ord IntValue Source # 
Instance details

Defined in Language.Futhark.Primitive

ToExp IntValue Source # 
Instance details

Defined in Futhark.CodeGen.Backends.SimpleRep

Methods

toExp :: IntValue -> SrcLoc -> Exp #

Pretty IntValue Source # 
Instance details

Defined in Language.Futhark.Primitive

Methods

ppr :: IntValue -> Doc #

pprPrec :: Int -> IntValue -> Doc #

pprList :: [IntValue] -> Doc #

class IsPrimValue v where Source #

A class for converting ordinary Haskell values to primitive Futhark values.

Methods

primValue :: v -> PrimValue Source #

Instances

Instances details
IsPrimValue Int16 Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Int32 Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Int64 Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Int8 Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Word16 Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Word32 Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Word64 Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Word8 Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Bool Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Double Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Float Source # 
Instance details

Defined in Language.Futhark.Syntax

IsPrimValue Int Source # 
Instance details

Defined in Language.Futhark.Syntax

data Value Source #

Simple Futhark values. Values are fully evaluated and their type is always unambiguous.

Constructors

PrimValue !PrimValue 
ArrayValue !(Array Int Value) ValueType

It is assumed that the array is 0-indexed. The type is the full type.

Instances

Instances details
Show Value Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

Eq Value Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

Pretty Value Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: Value -> Doc #

pprPrec :: Int -> Value -> Doc #

pprList :: [Value] -> Doc #

Abstract syntax tree

data AttrInfo vn Source #

The payload of an attribute.

Instances

Instances details
Show (AttrInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> AttrInfo vn -> ShowS #

show :: AttrInfo vn -> String #

showList :: [AttrInfo vn] -> ShowS #

Eq (AttrInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: AttrInfo vn -> AttrInfo vn -> Bool #

(/=) :: AttrInfo vn -> AttrInfo vn -> Bool #

Ord (AttrInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: AttrInfo vn -> AttrInfo vn -> Ordering #

(<) :: AttrInfo vn -> AttrInfo vn -> Bool #

(<=) :: AttrInfo vn -> AttrInfo vn -> Bool #

(>) :: AttrInfo vn -> AttrInfo vn -> Bool #

(>=) :: AttrInfo vn -> AttrInfo vn -> Bool #

max :: AttrInfo vn -> AttrInfo vn -> AttrInfo vn #

min :: AttrInfo vn -> AttrInfo vn -> AttrInfo vn #

IsName vn => Pretty (AttrInfo vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: AttrInfo vn -> Doc #

pprPrec :: Int -> AttrInfo vn -> Doc #

pprList :: [AttrInfo vn] -> Doc #

data AttrAtom vn Source #

The value of an AttrAtom.

Constructors

AtomName Name 
AtomInt Integer 

Instances

Instances details
Show (AttrAtom vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> AttrAtom vn -> ShowS #

show :: AttrAtom vn -> String #

showList :: [AttrAtom vn] -> ShowS #

Eq (AttrAtom vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: AttrAtom vn -> AttrAtom vn -> Bool #

(/=) :: AttrAtom vn -> AttrAtom vn -> Bool #

Ord (AttrAtom vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: AttrAtom vn -> AttrAtom vn -> Ordering #

(<) :: AttrAtom vn -> AttrAtom vn -> Bool #

(<=) :: AttrAtom vn -> AttrAtom vn -> Bool #

(>) :: AttrAtom vn -> AttrAtom vn -> Bool #

(>=) :: AttrAtom vn -> AttrAtom vn -> Bool #

max :: AttrAtom vn -> AttrAtom vn -> AttrAtom vn #

min :: AttrAtom vn -> AttrAtom vn -> AttrAtom vn #

IsName vn => Pretty (AttrAtom vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: AttrAtom vn -> Doc #

pprPrec :: Int -> AttrAtom vn -> Doc #

pprList :: [AttrAtom vn] -> Doc #

data BinOp Source #

Default binary operators.

Constructors

Backtick

A pseudo-operator standing in for any normal identifier used as an operator (they all have the same fixity). Binary Ops for Numbers

Plus 
Minus 
Pow 
Times 
Divide 
Mod 
Quot 
Rem 
ShiftR 
ShiftL 
Band 
Xor 
Bor 
LogAnd 
LogOr 
Equal 
NotEqual 
Less 
Leq 
Greater 
Geq 
PipeRight
|>
PipeLeft

<| Misc

Instances

Instances details
Bounded BinOp Source # 
Instance details

Defined in Language.Futhark.Syntax

Enum BinOp Source # 
Instance details

Defined in Language.Futhark.Syntax

Show BinOp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> BinOp -> ShowS #

show :: BinOp -> String #

showList :: [BinOp] -> ShowS #

Eq BinOp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: BinOp -> BinOp -> Bool #

(/=) :: BinOp -> BinOp -> Bool #

Ord BinOp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: BinOp -> BinOp -> Ordering #

(<) :: BinOp -> BinOp -> Bool #

(<=) :: BinOp -> BinOp -> Bool #

(>) :: BinOp -> BinOp -> Bool #

(>=) :: BinOp -> BinOp -> Bool #

max :: BinOp -> BinOp -> BinOp #

min :: BinOp -> BinOp -> BinOp #

Pretty BinOp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

ppr :: BinOp -> Doc #

pprPrec :: Int -> BinOp -> Doc #

pprList :: [BinOp] -> Doc #

data IdentBase f vn Source #

An identifier consists of its name and the type of the value bound to the identifier.

Constructors

Ident 

Fields

Instances

Instances details
Show (IdentBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (IdentBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (IdentBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq vn => Eq (IdentBase ty vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: IdentBase ty vn -> IdentBase ty vn -> Bool #

(/=) :: IdentBase ty vn -> IdentBase ty vn -> Bool #

Ord vn => Ord (IdentBase ty vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: IdentBase ty vn -> IdentBase ty vn -> Ordering #

(<) :: IdentBase ty vn -> IdentBase ty vn -> Bool #

(<=) :: IdentBase ty vn -> IdentBase ty vn -> Bool #

(>) :: IdentBase ty vn -> IdentBase ty vn -> Bool #

(>=) :: IdentBase ty vn -> IdentBase ty vn -> Bool #

max :: IdentBase ty vn -> IdentBase ty vn -> IdentBase ty vn #

min :: IdentBase ty vn -> IdentBase ty vn -> IdentBase ty vn #

IsName vn => Pretty (IdentBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: IdentBase f vn -> Doc #

pprPrec :: Int -> IdentBase f vn -> Doc #

pprList :: [IdentBase f vn] -> Doc #

Located (IdentBase ty vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: IdentBase ty vn -> Loc #

locOfList :: [IdentBase ty vn] -> Loc #

data Inclusiveness a Source #

Whether a bound for an end-point of a DimSlice or a range literal is inclusive or exclusive.

Constructors

DownToExclusive a 
ToInclusive a

May be "down to" if step is negative.

UpToExclusive a 

Instances

Instances details
Foldable Inclusiveness Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => Inclusiveness m -> m #

foldMap :: Monoid m => (a -> m) -> Inclusiveness a -> m #

foldMap' :: Monoid m => (a -> m) -> Inclusiveness a -> m #

foldr :: (a -> b -> b) -> b -> Inclusiveness a -> b #

foldr' :: (a -> b -> b) -> b -> Inclusiveness a -> b #

foldl :: (b -> a -> b) -> b -> Inclusiveness a -> b #

foldl' :: (b -> a -> b) -> b -> Inclusiveness a -> b #

foldr1 :: (a -> a -> a) -> Inclusiveness a -> a #

foldl1 :: (a -> a -> a) -> Inclusiveness a -> a #

toList :: Inclusiveness a -> [a] #

null :: Inclusiveness a -> Bool #

length :: Inclusiveness a -> Int #

elem :: Eq a => a -> Inclusiveness a -> Bool #

maximum :: Ord a => Inclusiveness a -> a #

minimum :: Ord a => Inclusiveness a -> a #

sum :: Num a => Inclusiveness a -> a #

product :: Num a => Inclusiveness a -> a #

Traversable Inclusiveness Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Inclusiveness a -> f (Inclusiveness b) #

sequenceA :: Applicative f => Inclusiveness (f a) -> f (Inclusiveness a) #

mapM :: Monad m => (a -> m b) -> Inclusiveness a -> m (Inclusiveness b) #

sequence :: Monad m => Inclusiveness (m a) -> m (Inclusiveness a) #

Functor Inclusiveness Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Show a => Show (Inclusiveness a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq a => Eq (Inclusiveness a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord a => Ord (Inclusiveness a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Located a => Located (Inclusiveness a) Source # 
Instance details

Defined in Language.Futhark.Syntax

data DimIndexBase f vn Source #

An indexing of a single dimension.

Constructors

DimFix (ExpBase f vn) 
DimSlice (Maybe (ExpBase f vn)) (Maybe (ExpBase f vn)) (Maybe (ExpBase f vn)) 

Instances

Instances details
Show (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (DimIndexBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (DimIndexBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (DimIndexBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (DimIndexBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: DimIndexBase f vn -> Doc #

pprPrec :: Int -> DimIndexBase f vn -> Doc #

pprList :: [DimIndexBase f vn] -> Doc #

type SliceBase f vn = [DimIndexBase f vn] Source #

A slicing of an array (potentially multiple dimensions).

data SizeBinder vn Source #

A binding of a size in a pattern (essentially a size parameter in a let expression).

Constructors

SizeBinder 

Fields

Instances

Instances details
Show vn => Show (SizeBinder vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> SizeBinder vn -> ShowS #

show :: SizeBinder vn -> String #

showList :: [SizeBinder vn] -> ShowS #

ASTMappable (SizeBinder VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq vn => Eq (SizeBinder vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: SizeBinder vn -> SizeBinder vn -> Bool #

(/=) :: SizeBinder vn -> SizeBinder vn -> Bool #

Ord vn => Ord (SizeBinder vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: SizeBinder vn -> SizeBinder vn -> Ordering #

(<) :: SizeBinder vn -> SizeBinder vn -> Bool #

(<=) :: SizeBinder vn -> SizeBinder vn -> Bool #

(>) :: SizeBinder vn -> SizeBinder vn -> Bool #

(>=) :: SizeBinder vn -> SizeBinder vn -> Bool #

max :: SizeBinder vn -> SizeBinder vn -> SizeBinder vn #

min :: SizeBinder vn -> SizeBinder vn -> SizeBinder vn #

IsName vn => Pretty (SizeBinder vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: SizeBinder vn -> Doc #

pprPrec :: Int -> SizeBinder vn -> Doc #

pprList :: [SizeBinder vn] -> Doc #

Located (SizeBinder vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: SizeBinder vn -> Loc #

locOfList :: [SizeBinder vn] -> Loc #

data AppExpBase f vn Source #

An "application expression" is a semantic (not syntactic) grouping of expressions that have "funcall-like" semantics, mostly meaning that they can return existential sizes. In our type theory, these are all thought to be bound to names (*Administrative Normal Form*), but as this is not practical in a real language, we instead use an annotation (AppRes) that stores the information we need, so we can pretend that an application expression was really bound to a name.

Constructors

Apply (ExpBase f vn) (ExpBase f vn) (f (Diet, Maybe VName)) SrcLoc

The Maybe VName is a possible existential size that is instantiated by this argument. May have duplicates across the program, but they will all produce the same value (the expressions will be identical).

Coerce (ExpBase f vn) (TypeExp vn) SrcLoc

Size coercion: e :> t.

Range (ExpBase f vn) (Maybe (ExpBase f vn)) (Inclusiveness (ExpBase f vn)) SrcLoc 
LetPat [SizeBinder vn] (PatBase f vn) (ExpBase f vn) (ExpBase f vn) SrcLoc 
LetFun vn ([TypeParamBase vn], [PatBase f vn], Maybe (TypeExp vn), f StructRetType, ExpBase f vn) (ExpBase f vn) SrcLoc 
If (ExpBase f vn) (ExpBase f vn) (ExpBase f vn) SrcLoc 
DoLoop [VName] (PatBase f vn) (ExpBase f vn) (LoopFormBase f vn) (ExpBase f vn) SrcLoc 
BinOp (QualName vn, SrcLoc) (f PatType) (ExpBase f vn, f (StructType, Maybe VName)) (ExpBase f vn, f (StructType, Maybe VName)) SrcLoc 
LetWith (IdentBase f vn) (IdentBase f vn) (SliceBase f vn) (ExpBase f vn) (ExpBase f vn) SrcLoc 
Index (ExpBase f vn) (SliceBase f vn) SrcLoc 
Match (ExpBase f vn) (NonEmpty (CaseBase f vn)) SrcLoc

A match expression.

Instances

Instances details
Show (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (AppExpBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (AppExpBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (AppExpBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (AppExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: AppExpBase f vn -> Doc #

pprPrec :: Int -> AppExpBase f vn -> Doc #

pprList :: [AppExpBase f vn] -> Doc #

Located (AppExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: AppExpBase f vn -> Loc #

locOfList :: [AppExpBase f vn] -> Loc #

data AppRes Source #

An annotation inserted by the type checker on constructs that are "function calls" (either literally or conceptually). This annotation encodes the result type, as well as any existential sizes that are generated here.

Constructors

AppRes 

Instances

Instances details
Show AppRes Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable AppRes Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> AppRes -> m AppRes Source #

Eq AppRes Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: AppRes -> AppRes -> Bool #

(/=) :: AppRes -> AppRes -> Bool #

Ord AppRes Source # 
Instance details

Defined in Language.Futhark.Syntax

data ExpBase f vn Source #

The Futhark expression language.

This allows us to encode whether or not the expression has been type-checked in the Haskell type of the expression. Specifically, the parser will produce expressions of type Exp NoInfo Name, and the type checker will convert these to Exp Info VName, in which type information is always present and all names are unique.

Constructors

Literal PrimValue SrcLoc 
IntLit Integer (f PatType) SrcLoc

A polymorphic integral literal.

FloatLit Double (f PatType) SrcLoc

A polymorphic decimal literal.

StringLit [Word8] SrcLoc

A string literal is just a fancy syntax for an array of bytes.

Hole (f PatType) SrcLoc 
Var (QualName vn) (f PatType) SrcLoc 
Parens (ExpBase f vn) SrcLoc

A parenthesized expression.

QualParens (QualName vn, SrcLoc) (ExpBase f vn) SrcLoc 
TupLit [ExpBase f vn] SrcLoc

Tuple literals, e.g., {1+3, {x, y+z}}.

RecordLit [FieldBase f vn] SrcLoc

Record literals, e.g. {x=2,y=3,z}.

ArrayLit [ExpBase f vn] (f PatType) SrcLoc

Array literals, e.g., [ [1+x, 3], [2, 1+4] ]. Second arg is the row type of the rows of the array.

Attr (AttrInfo vn) (ExpBase f vn) SrcLoc

An attribute applied to the following expression.

Project Name (ExpBase f vn) (f PatType) SrcLoc 
Negate (ExpBase f vn) SrcLoc

Numeric negation (ugly special case; Haskell did it first).

Not (ExpBase f vn) SrcLoc

Logical and bitwise negation.

Assert (ExpBase f vn) (ExpBase f vn) (f String) SrcLoc

Fail if the first expression does not return true, and return the value of the second expression if it does.

Constr Name [ExpBase f vn] (f PatType) SrcLoc

An n-ary value constructor.

Update (ExpBase f vn) (SliceBase f vn) (ExpBase f vn) SrcLoc 
RecordUpdate (ExpBase f vn) [Name] (ExpBase f vn) (f PatType) SrcLoc 
Lambda [PatBase f vn] (ExpBase f vn) (Maybe (TypeExp vn)) (f (Aliasing, StructRetType)) SrcLoc 
OpSection (QualName vn) (f PatType) SrcLoc

+; first two types are operands, third is result.

OpSectionLeft (QualName vn) (f PatType) (ExpBase f vn) (f (PName, StructType, Maybe VName), f (PName, StructType)) (f PatRetType, f [VName]) SrcLoc

2+; first type is operand, second is result.

OpSectionRight (QualName vn) (f PatType) (ExpBase f vn) (f (PName, StructType), f (PName, StructType, Maybe VName)) (f PatRetType) SrcLoc

+2; first type is operand, second is result.

ProjectSection [Name] (f PatType) SrcLoc

Field projection as a section: (.x.y.z).

IndexSection (SliceBase f vn) (f PatType) SrcLoc

Array indexing as a section: (.[i,j]).

Ascript (ExpBase f vn) (TypeExp vn) SrcLoc

Type ascription: e : t.

AppExp (AppExpBase f vn) (f AppRes) 

Instances

Instances details
Show (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (ExpBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (ExpBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (ExpBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (ExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: ExpBase f vn -> Doc #

pprPrec :: Int -> ExpBase f vn -> Doc #

pprList :: [ExpBase f vn] -> Doc #

Located (ExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: ExpBase f vn -> Loc #

locOfList :: [ExpBase f vn] -> Loc #

data FieldBase f vn Source #

An entry in a record literal.

Instances

Instances details
Show (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (FieldBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (FieldBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (FieldBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (FieldBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: FieldBase f vn -> Doc #

pprPrec :: Int -> FieldBase f vn -> Doc #

pprList :: [FieldBase f vn] -> Doc #

Located (FieldBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: FieldBase f vn -> Loc #

locOfList :: [FieldBase f vn] -> Loc #

data CaseBase f vn Source #

A case in a match expression.

Constructors

CasePat (PatBase f vn) (ExpBase f vn) SrcLoc 

Instances

Instances details
Show (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (CaseBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (CaseBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (CaseBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (CaseBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: CaseBase f vn -> Doc #

pprPrec :: Int -> CaseBase f vn -> Doc #

pprList :: [CaseBase f vn] -> Doc #

Located (CaseBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: CaseBase f vn -> Loc #

locOfList :: [CaseBase f vn] -> Loc #

data LoopFormBase f vn Source #

Whether the loop is a for-loop or a while-loop.

Constructors

For (IdentBase f vn) (ExpBase f vn) 
ForIn (PatBase f vn) (ExpBase f vn) 
While (ExpBase f vn) 

Instances

Instances details
Show (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (LoopFormBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (LoopFormBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (LoopFormBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (LoopFormBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: LoopFormBase f vn -> Doc #

pprPrec :: Int -> LoopFormBase f vn -> Doc #

pprList :: [LoopFormBase f vn] -> Doc #

data PatLit Source #

A literal in a pattern.

Instances

Instances details
Show PatLit Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq PatLit Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: PatLit -> PatLit -> Bool #

(/=) :: PatLit -> PatLit -> Bool #

Ord PatLit Source # 
Instance details

Defined in Language.Futhark.Syntax

Pretty PatLit Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: PatLit -> Doc #

pprPrec :: Int -> PatLit -> Doc #

pprList :: [PatLit] -> Doc #

data PatBase f vn Source #

A pattern as used most places where variables are bound (function parameters, let expressions, etc).

Instances

Instances details
Substitutable Pat Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Methods

applySubst :: TypeSubs -> Pat -> Pat Source #

Show (PatBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (PatBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (PatBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (PatBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (PatBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (PatBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (PatBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (PatBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: PatBase f vn -> Doc #

pprPrec :: Int -> PatBase f vn -> Doc #

pprList :: [PatBase f vn] -> Doc #

Located (PatBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: PatBase f vn -> Loc #

locOfList :: [PatBase f vn] -> Loc #

Module language

data SpecBase f vn Source #

A spec is a component of a module type.

Instances

Instances details
Show (SpecBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SpecBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (SpecBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: SpecBase f vn -> Doc #

pprPrec :: Int -> SpecBase f vn -> Doc #

pprList :: [SpecBase f vn] -> Doc #

Located (SpecBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: SpecBase f vn -> Loc #

locOfList :: [SpecBase f vn] -> Loc #

data SigExpBase f vn Source #

A module type expression.

Instances

Instances details
Show (SigExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SigExpBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (SigExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: SigExpBase f vn -> Doc #

pprPrec :: Int -> SigExpBase f vn -> Doc #

pprList :: [SigExpBase f vn] -> Doc #

Located (SigExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: SigExpBase f vn -> Loc #

locOfList :: [SigExpBase f vn] -> Loc #

data TypeRefBase vn Source #

A type refinement.

Constructors

TypeRef (QualName vn) [TypeParamBase vn] (TypeExp vn) SrcLoc 

Instances

Instances details
Show (TypeRefBase Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (TypeRefBase VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Located (TypeRefBase vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: TypeRefBase vn -> Loc #

locOfList :: [TypeRefBase vn] -> Loc #

data SigBindBase f vn Source #

Module type binding.

Constructors

SigBind 

Fields

Instances

Instances details
Show (SigBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SigBindBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (SigBindBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: SigBindBase f vn -> Doc #

pprPrec :: Int -> SigBindBase f vn -> Doc #

pprList :: [SigBindBase f vn] -> Doc #

Located (SigBindBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: SigBindBase f vn -> Loc #

locOfList :: [SigBindBase f vn] -> Loc #

data ModExpBase f vn Source #

Module expression.

Constructors

ModVar (QualName vn) SrcLoc 
ModParens (ModExpBase f vn) SrcLoc 
ModImport FilePath (f FilePath) SrcLoc

The contents of another file as a module.

ModDecs [DecBase f vn] SrcLoc 
ModApply (ModExpBase f vn) (ModExpBase f vn) (f (Map VName VName)) (f (Map VName VName)) SrcLoc

Functor application. The first mapping is from parameter names to argument names, while the second maps names in the constructed module to the names inside the functor.

ModAscript (ModExpBase f vn) (SigExpBase f vn) (f (Map VName VName)) SrcLoc 
ModLambda (ModParamBase f vn) (Maybe (SigExpBase f vn, f (Map VName VName))) (ModExpBase f vn) SrcLoc 

Instances

Instances details
Show (ModExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModExpBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (ModExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: ModExpBase f vn -> Doc #

pprPrec :: Int -> ModExpBase f vn -> Doc #

pprList :: [ModExpBase f vn] -> Doc #

Located (ModExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: ModExpBase f vn -> Loc #

locOfList :: [ModExpBase f vn] -> Loc #

data ModBindBase f vn Source #

A module binding.

Constructors

ModBind 

Instances

Instances details
Show (ModBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModBindBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (ModBindBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: ModBindBase f vn -> Doc #

pprPrec :: Int -> ModBindBase f vn -> Doc #

pprList :: [ModBindBase f vn] -> Doc #

Located (ModBindBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: ModBindBase f vn -> Loc #

locOfList :: [ModBindBase f vn] -> Loc #

data ModParamBase f vn Source #

A module parameter.

Constructors

ModParam 

Instances

Instances details
Show (ModParamBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModParamBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (ModParamBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: ModParamBase f vn -> Doc #

pprPrec :: Int -> ModParamBase f vn -> Doc #

pprList :: [ModParamBase f vn] -> Doc #

Located (ModParamBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: ModParamBase f vn -> Loc #

locOfList :: [ModParamBase f vn] -> Loc #

Definitions

data DocComment Source #

Documentation strings, including source location.

Constructors

DocComment String SrcLoc 

Instances

Instances details
Show DocComment Source # 
Instance details

Defined in Language.Futhark.Syntax

Located DocComment Source # 
Instance details

Defined in Language.Futhark.Syntax

data ValBindBase f vn Source #

Function Declarations

Constructors

ValBind 

Fields

Instances

Instances details
Show (ValBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ValBindBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (ValBindBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: ValBindBase f vn -> Doc #

pprPrec :: Int -> ValBindBase f vn -> Doc #

pprList :: [ValBindBase f vn] -> Doc #

Located (ValBindBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: ValBindBase f vn -> Loc #

locOfList :: [ValBindBase f vn] -> Loc #

data EntryPoint Source #

Information about the external interface exposed by an entry point. The important thing is that that we remember the original source-language types, without desugaring them at all. The annoying thing is that we do not require type annotations on entry points, so the types can be either ascribed or inferred.

Constructors

EntryPoint 

Instances

Instances details
Show EntryPoint Source # 
Instance details

Defined in Language.Futhark.Syntax

data EntryType Source #

Part of the type of an entry point. Has an actual type, and maybe also an ascribed type expression.

Instances

Instances details
Show EntryType Source # 
Instance details

Defined in Language.Futhark.Syntax

data EntryParam Source #

A parameter of an entry point.

Instances

Instances details
Show EntryParam Source # 
Instance details

Defined in Language.Futhark.Syntax

data Liftedness Source #

The liftedness of a type parameter. By the Ord instance, Unlifted < SizeLifted < Lifted.

Constructors

Unlifted

May only be instantiated with a zero-order type of (possibly symbolically) known size.

SizeLifted

May only be instantiated with a zero-order type, but the size can be varying.

Lifted

May be instantiated with a functional type.

data TypeBindBase f vn Source #

Type Declarations

Instances

Instances details
Show (TypeBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (TypeBindBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (TypeBindBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: TypeBindBase f vn -> Doc #

pprPrec :: Int -> TypeBindBase f vn -> Doc #

pprList :: [TypeBindBase f vn] -> Doc #

Located (TypeBindBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: TypeBindBase f vn -> Loc #

locOfList :: [TypeBindBase f vn] -> Loc #

data TypeParamBase vn Source #

A type parameter.

Constructors

TypeParamDim vn SrcLoc

A type parameter that must be a size.

TypeParamType Liftedness vn SrcLoc

A type parameter that must be a type.

Instances

Instances details
Foldable TypeParamBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => TypeParamBase m -> m #

foldMap :: Monoid m => (a -> m) -> TypeParamBase a -> m #

foldMap' :: Monoid m => (a -> m) -> TypeParamBase a -> m #

foldr :: (a -> b -> b) -> b -> TypeParamBase a -> b #

foldr' :: (a -> b -> b) -> b -> TypeParamBase a -> b #

foldl :: (b -> a -> b) -> b -> TypeParamBase a -> b #

foldl' :: (b -> a -> b) -> b -> TypeParamBase a -> b #

foldr1 :: (a -> a -> a) -> TypeParamBase a -> a #

foldl1 :: (a -> a -> a) -> TypeParamBase a -> a #

toList :: TypeParamBase a -> [a] #

null :: TypeParamBase a -> Bool #

length :: TypeParamBase a -> Int #

elem :: Eq a => a -> TypeParamBase a -> Bool #

maximum :: Ord a => TypeParamBase a -> a #

minimum :: Ord a => TypeParamBase a -> a #

sum :: Num a => TypeParamBase a -> a #

product :: Num a => TypeParamBase a -> a #

Traversable TypeParamBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> TypeParamBase a -> f (TypeParamBase b) #

sequenceA :: Applicative f => TypeParamBase (f a) -> f (TypeParamBase a) #

mapM :: Monad m => (a -> m b) -> TypeParamBase a -> m (TypeParamBase b) #

sequence :: Monad m => TypeParamBase (m a) -> m (TypeParamBase a) #

Functor TypeParamBase Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Show vn => Show (TypeParamBase vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (TypeParamBase VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq vn => Eq (TypeParamBase vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord vn => Ord (TypeParamBase vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn) => Pretty (TypeParamBase vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: TypeParamBase vn -> Doc #

pprPrec :: Int -> TypeParamBase vn -> Doc #

pprList :: [TypeParamBase vn] -> Doc #

Located (TypeParamBase vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: TypeParamBase vn -> Loc #

locOfList :: [TypeParamBase vn] -> Loc #

typeParamName :: TypeParamBase vn -> vn Source #

The name of a type parameter.

data ProgBase f vn Source #

The program described by a single Futhark file. May depend on other files.

Constructors

Prog 

Fields

Instances

Instances details
Show (ProgBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ProgBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (ProgBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: ProgBase f vn -> Doc #

pprPrec :: Int -> ProgBase f vn -> Doc #

pprList :: [ProgBase f vn] -> Doc #

data DecBase f vn Source #

A top-level binding.

Instances

Instances details
Show (DecBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (DecBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Eq vn, IsName vn, Annot f) => Pretty (DecBase f vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: DecBase f vn -> Doc #

pprPrec :: Int -> DecBase f vn -> Doc #

pprList :: [DecBase f vn] -> Doc #

Located (DecBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: DecBase f vn -> Loc #

locOfList :: [DecBase f vn] -> Loc #

Miscellaneous

data NoInfo a Source #

No information functor. Usually used for placeholder type- or aliasing information.

Constructors

NoInfo 

Instances

Instances details
Foldable NoInfo Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => NoInfo m -> m #

foldMap :: Monoid m => (a -> m) -> NoInfo a -> m #

foldMap' :: Monoid m => (a -> m) -> NoInfo a -> m #

foldr :: (a -> b -> b) -> b -> NoInfo a -> b #

foldr' :: (a -> b -> b) -> b -> NoInfo a -> b #

foldl :: (b -> a -> b) -> b -> NoInfo a -> b #

foldl' :: (b -> a -> b) -> b -> NoInfo a -> b #

foldr1 :: (a -> a -> a) -> NoInfo a -> a #

foldl1 :: (a -> a -> a) -> NoInfo a -> a #

toList :: NoInfo a -> [a] #

null :: NoInfo a -> Bool #

length :: NoInfo a -> Int #

elem :: Eq a => a -> NoInfo a -> Bool #

maximum :: Ord a => NoInfo a -> a #

minimum :: Ord a => NoInfo a -> a #

sum :: Num a => NoInfo a -> a #

product :: Num a => NoInfo a -> a #

Traversable NoInfo Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> NoInfo a -> f (NoInfo b) #

sequenceA :: Applicative f => NoInfo (f a) -> f (NoInfo a) #

mapM :: Monad m => (a -> m b) -> NoInfo a -> m (NoInfo b) #

sequence :: Monad m => NoInfo (m a) -> m (NoInfo a) #

Functor NoInfo Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Annot NoInfo Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

unAnnot :: NoInfo a -> Maybe a Source #

Show (NoInfo a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> NoInfo a -> ShowS #

show :: NoInfo a -> String #

showList :: [NoInfo a] -> ShowS #

Eq (NoInfo a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: NoInfo a -> NoInfo a -> Bool #

(/=) :: NoInfo a -> NoInfo a -> Bool #

Ord (NoInfo a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: NoInfo a -> NoInfo a -> Ordering #

(<) :: NoInfo a -> NoInfo a -> Bool #

(<=) :: NoInfo a -> NoInfo a -> Bool #

(>) :: NoInfo a -> NoInfo a -> Bool #

(>=) :: NoInfo a -> NoInfo a -> Bool #

max :: NoInfo a -> NoInfo a -> NoInfo a #

min :: NoInfo a -> NoInfo a -> NoInfo a #

Show vn => Show (AppExpBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (CaseBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (DecBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (DimIndexBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (ExpBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (FieldBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (IdentBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (LoopFormBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModBindBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModExpBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModParamBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show vn => Show (PatBase NoInfo vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ProgBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SigBindBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SigExpBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SpecBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (TypeBindBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ValBindBase NoInfo Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (AppExpBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (CaseBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (DimIndexBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (ExpBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (FieldBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (LoopFormBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (PatBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (AppExpBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (CaseBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (DimIndexBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (ExpBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (FieldBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (LoopFormBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (PatBase NoInfo VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

newtype Info a Source #

Some information. The dual to NoInfo

Constructors

Info 

Fields

Instances

Instances details
Foldable Info Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => Info m -> m #

foldMap :: Monoid m => (a -> m) -> Info a -> m #

foldMap' :: Monoid m => (a -> m) -> Info a -> m #

foldr :: (a -> b -> b) -> b -> Info a -> b #

foldr' :: (a -> b -> b) -> b -> Info a -> b #

foldl :: (b -> a -> b) -> b -> Info a -> b #

foldl' :: (b -> a -> b) -> b -> Info a -> b #

foldr1 :: (a -> a -> a) -> Info a -> a #

foldl1 :: (a -> a -> a) -> Info a -> a #

toList :: Info a -> [a] #

null :: Info a -> Bool #

length :: Info a -> Int #

elem :: Eq a => a -> Info a -> Bool #

maximum :: Ord a => Info a -> a #

minimum :: Ord a => Info a -> a #

sum :: Num a => Info a -> a #

product :: Num a => Info a -> a #

Traversable Info Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Info a -> f (Info b) #

sequenceA :: Applicative f => Info (f a) -> f (Info a) #

mapM :: Monad m => (a -> m b) -> Info a -> m (Info b) #

sequence :: Monad m => Info (m a) -> m (Info a) #

Functor Info Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Annot Info Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

unAnnot :: Info a -> Maybe a Source #

Substitutable Pat Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Methods

applySubst :: TypeSubs -> Pat -> Pat Source #

Show a => Show (Info a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> Info a -> ShowS #

show :: Info a -> String #

showList :: [Info a] -> ShowS #

ASTMappable a => ASTMappable (Info a) Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> Info a -> m (Info a) Source #

Eq a => Eq (Info a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: Info a -> Info a -> Bool #

(/=) :: Info a -> Info a -> Bool #

Ord a => Ord (Info a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: Info a -> Info a -> Ordering #

(<) :: Info a -> Info a -> Bool #

(<=) :: Info a -> Info a -> Bool #

(>) :: Info a -> Info a -> Bool #

(>=) :: Info a -> Info a -> Bool #

max :: Info a -> Info a -> Info a #

min :: Info a -> Info a -> Info a #

Show (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (DecBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (IdentBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModParamBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (PatBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ProgBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SigBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SigExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SpecBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (TypeBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ValBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (IdentBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (PatBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (PatBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (PatBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

data Alias Source #

A variable that is aliased. Can be still in-scope, or have gone out of scope and be free. In the latter case, it behaves more like an equivalence class. See uniqueness-error18.fut for an example of why this is necessary.

Constructors

AliasBound 

Fields

AliasFree 

Fields

Instances

Instances details
Show Alias Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> Alias -> ShowS #

show :: Alias -> String #

showList :: [Alias] -> ShowS #

ASTMappable Alias Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> Alias -> m Alias Source #

ASTMappable Aliasing Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> Aliasing -> m Aliasing Source #

ASTMappable PatRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable PatType Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

astMap :: Monad m => ASTMapper m -> PatType -> m PatType Source #

Eq Alias Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: Alias -> Alias -> Bool #

(/=) :: Alias -> Alias -> Bool #

Ord Alias Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: Alias -> Alias -> Ordering #

(<) :: Alias -> Alias -> Bool #

(<=) :: Alias -> Alias -> Bool #

(>) :: Alias -> Alias -> Bool #

(>=) :: Alias -> Alias -> Bool #

max :: Alias -> Alias -> Alias #

min :: Alias -> Alias -> Alias #

Substitutable (RetTypeBase Size Aliasing) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (TypeBase Size Aliasing) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

type Aliasing = Set Alias Source #

Aliasing for a type, which is a set of the variables that are aliased.

data QualName vn Source #

A name qualified with a breadcrumb of module accesses.

Constructors

QualName 

Fields

Instances

Instances details
Foldable QualName Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => QualName m -> m #

foldMap :: Monoid m => (a -> m) -> QualName a -> m #

foldMap' :: Monoid m => (a -> m) -> QualName a -> m #

foldr :: (a -> b -> b) -> b -> QualName a -> b #

foldr' :: (a -> b -> b) -> b -> QualName a -> b #

foldl :: (b -> a -> b) -> b -> QualName a -> b #

foldl' :: (b -> a -> b) -> b -> QualName a -> b #

foldr1 :: (a -> a -> a) -> QualName a -> a #

foldl1 :: (a -> a -> a) -> QualName a -> a #

toList :: QualName a -> [a] #

null :: QualName a -> Bool #

length :: QualName a -> Int #

elem :: Eq a => a -> QualName a -> Bool #

maximum :: Ord a => QualName a -> a #

minimum :: Ord a => QualName a -> a #

sum :: Num a => QualName a -> a #

product :: Num a => QualName a -> a #

Traversable QualName Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> QualName a -> f (QualName b) #

sequenceA :: Applicative f => QualName (f a) -> f (QualName a) #

mapM :: Monad m => (a -> m b) -> QualName a -> m (QualName b) #

sequence :: Monad m => QualName (m a) -> m (QualName a) #

Functor QualName Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Show vn => Show (QualName vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> QualName vn -> ShowS #

show :: QualName vn -> String #

showList :: [QualName vn] -> ShowS #

ASTMappable (QualName VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (QualName Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (QualName VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (QualName Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (QualName VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

IsName vn => Pretty (QualName vn) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

ppr :: QualName vn -> Doc #

pprPrec :: Int -> QualName vn -> Doc #

pprList :: [QualName vn] -> Doc #