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

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

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

Prettyprint a value to a String, appropriately wrapped.

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

Prettyprint a value to a Text, appropriately wrapped.

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

ExtTyped DeclExtType 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

ASTMappable ResRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

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

Methods

pretty :: Uniqueness -> Doc ann #

prettyList :: [Uniqueness] -> Doc ann #

Simplifiable [FunReturns] Source # 
Instance details

Defined in Futhark.IR.Mem

ASTMappable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable (RetTypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

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

FixExt ret => ExtTyped (MemInfo ExtSize 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

pretty :: IntType -> Doc ann #

prettyList :: [IntType] -> Doc ann #

data FloatType Source #

A floating point type.

Constructors

Float16 
Float32 
Float64 

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

pretty :: PrimType -> Doc ann #

prettyList :: [PrimType] -> Doc ann #

type Size = ExpBase Info VName Source #

The elaborated size of a dimension is just an expression.

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

pretty :: Shape Int64 -> Doc ann #

prettyList :: [Shape Int64] -> Doc ann #

Pretty (Shape Size) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: Shape Size -> Doc ann #

prettyList :: [Shape Size] -> Doc ann #

Pretty (Shape ()) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: Shape () -> Doc ann #

prettyList :: [Shape ()] -> Doc ann #

Pretty (Shape Bool) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: Shape Bool -> Doc ann #

prettyList :: [Shape Bool] -> Doc ann #

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 u 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 u) 
Array u (Shape dim) (ScalarTypeBase dim NoUniqueness) 

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 ParamType Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

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

ASTMappable StructType Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable ParamType Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable StructType Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Foldable (TypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => TypeBase dim m -> m #

foldMap :: Monoid m => (a -> m) -> TypeBase dim a -> m #

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

foldr :: (a -> b -> b) -> b -> TypeBase dim a -> b #

foldr' :: (a -> b -> b) -> b -> TypeBase dim a -> b #

foldl :: (b -> a -> b) -> b -> TypeBase dim a -> b #

foldl' :: (b -> a -> b) -> b -> TypeBase dim a -> b #

foldr1 :: (a -> a -> a) -> TypeBase dim a -> a #

foldl1 :: (a -> a -> a) -> TypeBase dim a -> a #

toList :: TypeBase dim a -> [a] #

null :: TypeBase dim a -> Bool #

length :: TypeBase dim a -> Int #

elem :: Eq a => a -> TypeBase dim a -> Bool #

maximum :: Ord a => TypeBase dim a -> a #

minimum :: Ord a => TypeBase dim a -> a #

sum :: Num a => TypeBase dim a -> a #

product :: Num a => TypeBase dim a -> a #

Traversable (TypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

sequenceA :: Applicative f => TypeBase dim (f a) -> f (TypeBase dim a) #

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

sequence :: Monad m => TypeBase dim (m a) -> m (TypeBase dim a) #

Functor (TypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fmap :: (a -> b) -> TypeBase dim a -> TypeBase dim b #

(<$) :: a -> TypeBase dim b -> TypeBase dim a #

Substitutable (Pat ParamType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (Pat StructType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

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

Defined in Language.Futhark.Syntax

Methods

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

show :: TypeBase dim u -> String #

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

ASTMappable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

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

Defined in Language.Futhark.Syntax

Methods

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

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

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

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

max :: TypeBase dim u -> TypeBase dim u -> TypeBase dim u #

min :: TypeBase dim u -> TypeBase dim u -> TypeBase dim u #

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

Defined in Language.Futhark.Pretty

Methods

pretty :: TypeBase dim u -> Doc ann #

prettyList :: [TypeBase dim u] -> Doc ann #

ASTMappable (PatBase Info VName ParamType) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (PatBase Info VName StructType) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (IdentBase Info VName StructType) Source # 
Instance details

Defined in Language.Futhark.Traversals

data TypeArg dim Source #

An argument passed to a type constructor.

Constructors

TypeArgDim dim 
TypeArgType (TypeBase dim NoUniqueness) 

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 (TypeArg Size) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: TypeArg Size -> Doc ann #

prettyList :: [TypeArg Size] -> Doc ann #

data SizeExp d Source #

A dimension declaration expression for use in a TypeExp. Syntactically includes the brackets.

Constructors

SizeExp d SrcLoc

The size of the dimension is this expression (or whatever), all of which free variables must be in scope.

SizeExpAny SrcLoc

No dimension declaration.

Instances

Instances details
Foldable SizeExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

toList :: SizeExp a -> [a] #

null :: SizeExp a -> Bool #

length :: SizeExp a -> Int #

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

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

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

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

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

Traversable SizeExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

Functor SizeExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Show d => Show (SizeExp d) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

show :: SizeExp d -> String #

showList :: [SizeExp d] -> ShowS #

ASTMappable (SizeExp (ExpBase Info VName)) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq d => Eq (SizeExp d) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: SizeExp d -> SizeExp d -> Bool #

(/=) :: SizeExp d -> SizeExp d -> Bool #

Ord d => Ord (SizeExp d) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: SizeExp d -> SizeExp d -> Ordering #

(<) :: SizeExp d -> SizeExp d -> Bool #

(<=) :: SizeExp d -> SizeExp d -> Bool #

(>) :: SizeExp d -> SizeExp d -> Bool #

(>=) :: SizeExp d -> SizeExp d -> Bool #

max :: SizeExp d -> SizeExp d -> SizeExp d #

min :: SizeExp d -> SizeExp d -> SizeExp d #

Pretty d => Pretty (SizeExp d) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: SizeExp d -> Doc ann #

prettyList :: [SizeExp d] -> Doc ann #

Located (SizeExp d) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: SizeExp d -> Loc #

locOfList :: [SizeExp d] -> Loc #

data TypeExp d vn Source #

An unstructured syntactic 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.

Constructors

TEVar (QualName vn) SrcLoc 
TEParens (TypeExp d vn) SrcLoc 
TETuple [TypeExp d vn] SrcLoc 
TERecord [(Name, TypeExp d vn)] SrcLoc 
TEArray (SizeExp d) (TypeExp d vn) SrcLoc 
TEUnique (TypeExp d vn) SrcLoc 
TEApply (TypeExp d vn) (TypeArgExp d vn) SrcLoc 
TEArrow (Maybe vn) (TypeExp d vn) (TypeExp d vn) SrcLoc 
TESum [(Name, [TypeExp d vn])] SrcLoc 
TEDim [vn] (TypeExp d vn) SrcLoc 

Instances

Instances details
Bifoldable TypeExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

Bifunctor TypeExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

Bitraversable TypeExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

Foldable (TypeExp dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => TypeExp dim m -> m #

foldMap :: Monoid m => (a -> m) -> TypeExp dim a -> m #

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

foldr :: (a -> b -> b) -> b -> TypeExp dim a -> b #

foldr' :: (a -> b -> b) -> b -> TypeExp dim a -> b #

foldl :: (b -> a -> b) -> b -> TypeExp dim a -> b #

foldl' :: (b -> a -> b) -> b -> TypeExp dim a -> b #

foldr1 :: (a -> a -> a) -> TypeExp dim a -> a #

foldl1 :: (a -> a -> a) -> TypeExp dim a -> a #

toList :: TypeExp dim a -> [a] #

null :: TypeExp dim a -> Bool #

length :: TypeExp dim a -> Int #

elem :: Eq a => a -> TypeExp dim a -> Bool #

maximum :: Ord a => TypeExp dim a -> a #

minimum :: Ord a => TypeExp dim a -> a #

sum :: Num a => TypeExp dim a -> a #

product :: Num a => TypeExp dim a -> a #

Traversable (TypeExp dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

sequenceA :: Applicative f => TypeExp dim (f a) -> f (TypeExp dim a) #

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

sequence :: Monad m => TypeExp dim (m a) -> m (TypeExp dim a) #

Functor (TypeExp d) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fmap :: (a -> b) -> TypeExp d a -> TypeExp d b #

(<$) :: a -> TypeExp d b -> TypeExp d a #

(Show vn, Show d) => Show (TypeExp d vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

show :: TypeExp d vn -> String #

showList :: [TypeExp d vn] -> ShowS #

ASTMappable (TypeExp (ExpBase Info VName) VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

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

Defined in Language.Futhark.Syntax

Methods

(==) :: TypeExp d vn -> TypeExp d vn -> Bool #

(/=) :: TypeExp d vn -> TypeExp d vn -> Bool #

(Ord vn, Ord d) => Ord (TypeExp d vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: TypeExp d vn -> TypeExp d vn -> Ordering #

(<) :: TypeExp d vn -> TypeExp d vn -> Bool #

(<=) :: TypeExp d vn -> TypeExp d vn -> Bool #

(>) :: TypeExp d vn -> TypeExp d vn -> Bool #

(>=) :: TypeExp d vn -> TypeExp d vn -> Bool #

max :: TypeExp d vn -> TypeExp d vn -> TypeExp d vn #

min :: TypeExp d vn -> TypeExp d vn -> TypeExp d vn #

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

Defined in Language.Futhark.Pretty

Methods

pretty :: TypeExp d vn -> Doc ann #

prettyList :: [TypeExp d vn] -> Doc ann #

Located (TypeExp f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: TypeExp f vn -> Loc #

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

data TypeArgExp d vn Source #

A type argument expression passed to a type constructor.

Constructors

TypeArgExpSize (SizeExp d) 
TypeArgExpType (TypeExp d vn) 

Instances

Instances details
Bifoldable TypeArgExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

Bifunctor TypeArgExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

Bitraversable TypeArgExp Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

Foldable (TypeArgExp d) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => TypeArgExp d m -> m #

foldMap :: Monoid m => (a -> m) -> TypeArgExp d a -> m #

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

foldr :: (a -> b -> b) -> b -> TypeArgExp d a -> b #

foldr' :: (a -> b -> b) -> b -> TypeArgExp d a -> b #

foldl :: (b -> a -> b) -> b -> TypeArgExp d a -> b #

foldl' :: (b -> a -> b) -> b -> TypeArgExp d a -> b #

foldr1 :: (a -> a -> a) -> TypeArgExp d a -> a #

foldl1 :: (a -> a -> a) -> TypeArgExp d a -> a #

toList :: TypeArgExp d a -> [a] #

null :: TypeArgExp d a -> Bool #

length :: TypeArgExp d a -> Int #

elem :: Eq a => a -> TypeArgExp d a -> Bool #

maximum :: Ord a => TypeArgExp d a -> a #

minimum :: Ord a => TypeArgExp d a -> a #

sum :: Num a => TypeArgExp d a -> a #

product :: Num a => TypeArgExp d a -> a #

Traversable (TypeArgExp d) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

sequenceA :: Applicative f => TypeArgExp d (f a) -> f (TypeArgExp d a) #

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

sequence :: Monad m => TypeArgExp d (m a) -> m (TypeArgExp d a) #

Functor (TypeArgExp d) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fmap :: (a -> b) -> TypeArgExp d a -> TypeArgExp d b #

(<$) :: a -> TypeArgExp d b -> TypeArgExp d a #

(Show d, Show vn) => Show (TypeArgExp d vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

show :: TypeArgExp d vn -> String #

showList :: [TypeArgExp d vn] -> ShowS #

ASTMappable (TypeArgExp (ExpBase Info VName) VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

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

Defined in Language.Futhark.Syntax

Methods

(==) :: TypeArgExp d vn -> TypeArgExp d vn -> Bool #

(/=) :: TypeArgExp d vn -> TypeArgExp d vn -> Bool #

(Ord d, Ord vn) => Ord (TypeArgExp d vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: TypeArgExp d vn -> TypeArgExp d vn -> Ordering #

(<) :: TypeArgExp d vn -> TypeArgExp d vn -> Bool #

(<=) :: TypeArgExp d vn -> TypeArgExp d vn -> Bool #

(>) :: TypeArgExp d vn -> TypeArgExp d vn -> Bool #

(>=) :: TypeArgExp d vn -> TypeArgExp d vn -> Bool #

max :: TypeArgExp d vn -> TypeArgExp d vn -> TypeArgExp d vn #

min :: TypeArgExp d vn -> TypeArgExp d vn -> TypeArgExp d vn #

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

Defined in Language.Futhark.Pretty

Methods

pretty :: TypeArgExp d vn -> Doc ann #

prettyList :: [TypeArgExp d vn] -> Doc ann #

Located (TypeArgExp f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: TypeArgExp f vn -> Loc #

locOfList :: [TypeArgExp f 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 u 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 u (QualName VName) [TypeArg dim] 
Record (Map Name (TypeBase dim u)) 
Sum (Map Name [TypeBase dim u]) 
Arrow u PName Diet (TypeBase dim NoUniqueness) (RetTypeBase dim Uniqueness)

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) #

Foldable (ScalarTypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => ScalarTypeBase dim m -> m #

foldMap :: Monoid m => (a -> m) -> ScalarTypeBase dim a -> m #

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

foldr :: (a -> b -> b) -> b -> ScalarTypeBase dim a -> b #

foldr' :: (a -> b -> b) -> b -> ScalarTypeBase dim a -> b #

foldl :: (b -> a -> b) -> b -> ScalarTypeBase dim a -> b #

foldl' :: (b -> a -> b) -> b -> ScalarTypeBase dim a -> b #

foldr1 :: (a -> a -> a) -> ScalarTypeBase dim a -> a #

foldl1 :: (a -> a -> a) -> ScalarTypeBase dim a -> a #

toList :: ScalarTypeBase dim a -> [a] #

null :: ScalarTypeBase dim a -> Bool #

length :: ScalarTypeBase dim a -> Int #

elem :: Eq a => a -> ScalarTypeBase dim a -> Bool #

maximum :: Ord a => ScalarTypeBase dim a -> a #

minimum :: Ord a => ScalarTypeBase dim a -> a #

sum :: Num a => ScalarTypeBase dim a -> a #

product :: Num a => ScalarTypeBase dim a -> a #

Traversable (ScalarTypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

sequenceA :: Applicative f => ScalarTypeBase dim (f a) -> f (ScalarTypeBase dim a) #

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

sequence :: Monad m => ScalarTypeBase dim (m a) -> m (ScalarTypeBase dim a) #

Functor (ScalarTypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fmap :: (a -> b) -> ScalarTypeBase dim a -> ScalarTypeBase dim b #

(<$) :: a -> ScalarTypeBase dim b -> ScalarTypeBase dim a #

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

Defined in Language.Futhark.Syntax

Methods

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

show :: ScalarTypeBase dim u -> String #

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

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

Defined in Language.Futhark.Syntax

Methods

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

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

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

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

max :: ScalarTypeBase dim u -> ScalarTypeBase dim u -> ScalarTypeBase dim u #

min :: ScalarTypeBase dim u -> ScalarTypeBase dim u -> ScalarTypeBase dim u #

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

Defined in Language.Futhark.Pretty

Methods

pretty :: ScalarTypeBase dim u -> Doc ann #

prettyList :: [ScalarTypeBase dim u] -> Doc ann #

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 ResRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

Foldable (RetTypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => RetTypeBase dim m -> m #

foldMap :: Monoid m => (a -> m) -> RetTypeBase dim a -> m #

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

foldr :: (a -> b -> b) -> b -> RetTypeBase dim a -> b #

foldr' :: (a -> b -> b) -> b -> RetTypeBase dim a -> b #

foldl :: (b -> a -> b) -> b -> RetTypeBase dim a -> b #

foldl' :: (b -> a -> b) -> b -> RetTypeBase dim a -> b #

foldr1 :: (a -> a -> a) -> RetTypeBase dim a -> a #

foldl1 :: (a -> a -> a) -> RetTypeBase dim a -> a #

toList :: RetTypeBase dim a -> [a] #

null :: RetTypeBase dim a -> Bool #

length :: RetTypeBase dim a -> Int #

elem :: Eq a => a -> RetTypeBase dim a -> Bool #

maximum :: Ord a => RetTypeBase dim a -> a #

minimum :: Ord a => RetTypeBase dim a -> a #

sum :: Num a => RetTypeBase dim a -> a #

product :: Num a => RetTypeBase dim a -> a #

Traversable (RetTypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

sequenceA :: Applicative f => RetTypeBase dim (f a) -> f (RetTypeBase dim a) #

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

sequence :: Monad m => RetTypeBase dim (m a) -> m (RetTypeBase dim a) #

Functor (RetTypeBase dim) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fmap :: (a -> b) -> RetTypeBase dim a -> RetTypeBase dim b #

(<$) :: a -> RetTypeBase dim b -> RetTypeBase dim a #

(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 NoUniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (RetTypeBase Size Uniqueness) 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 u) => Pretty (RetTypeBase dim u) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: RetTypeBase dim u -> Doc ann #

prettyList :: [RetTypeBase dim u] -> Doc ann #

type StructType = TypeBase Size NoUniqueness Source #

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

type ParamType = TypeBase Size Diet Source #

A type with consumption information, used for function parameters (but not in function types).

type ResType = TypeBase Size Uniqueness Source #

A type with uniqueness information, used for function return types

type StructRetType = RetTypeBase Size NoUniqueness Source #

The return type version of a ResType.

type ResRetType = RetTypeBase Size Uniqueness Source #

The return type version of a StructType.

type ValueType = TypeBase Int64 NoUniqueness Source #

A value type contains full, manifest size information.

data Diet Source #

Information about which parts of a parameter are consumed. This can be considered kind of an effect on the function.

Constructors

Observe

Does not consume the parameter.

Consume

Consumes the parameter.

Instances

Instances details
Monoid Diet Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

mempty :: Diet #

mappend :: Diet -> Diet -> Diet #

mconcat :: [Diet] -> Diet #

Semigroup Diet Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

sconcat :: NonEmpty Diet -> Diet #

stimes :: Integral b => b -> Diet -> Diet #

Show Diet Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> Diet -> ShowS #

show :: Diet -> String #

showList :: [Diet] -> ShowS #

ASTMappable ParamType Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

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

Substitutable ParamType Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

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 #

Pretty Diet Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: Diet -> Doc ann #

prettyList :: [Diet] -> Doc ann #

Substitutable (Pat ParamType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

ASTMappable (PatBase Info VName ParamType) Source # 
Instance details

Defined in Language.Futhark.Traversals

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

pretty :: IntValue -> Doc ann #

prettyList :: [IntValue] -> Doc ann #

data PrimValue Source #

Non-array values.

Instances

Instances details
Show PrimValue Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq PrimValue Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord PrimValue Source # 
Instance details

Defined in Language.Futhark.Syntax

Pretty PrimValue Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: PrimValue -> Doc ann #

prettyList :: [PrimValue] -> Doc ann #

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

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

pretty :: AttrInfo vn -> Doc ann #

prettyList :: [AttrInfo vn] -> Doc ann #

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

pretty :: AttrAtom vn -> Doc ann #

prettyList :: [AttrAtom vn] -> Doc ann #

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).

Bang

Not a real operator, but operator with this as a prefix may be defined by the user.

Equ

Not a real operator, but operator with this as a prefix may be defined by the user.

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

pretty :: BinOp -> Doc ann #

prettyList :: [BinOp] -> Doc ann #

data IdentBase f vn t Source #

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

Constructors

Ident 

Fields

Instances

Instances details
Show (Info t) => Show (IdentBase Info VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Show (Info t), Show vn) => Show (IdentBase (NoInfo :: Type -> Type) vn t) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (IdentBase Info VName StructType) Source # 
Instance details

Defined in Language.Futhark.Traversals

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

Defined in Language.Futhark.Syntax

Methods

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

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

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

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

Defined in Language.Futhark.Pretty

Methods

pretty :: IdentBase f vn t -> Doc ann #

prettyList :: [IdentBase f vn t] -> Doc ann #

Located (IdentBase ty vn t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: IdentBase ty vn t -> Loc #

locOfList :: [IdentBase ty vn t] -> 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 :: Type -> Type) 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 :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (DimIndexBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (DimIndexBase (NoInfo :: Type -> Type) 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

pretty :: DimIndexBase f vn -> Doc ann #

prettyList :: [DimIndexBase f vn] -> Doc ann #

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 #

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

pretty :: SizeBinder vn -> Doc ann #

prettyList :: [SizeBinder vn] -> Doc ann #

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) (NonEmpty (f (Maybe VName), ExpBase f vn)) SrcLoc

Function application. Parts of the compiler expects that the function expression is never itself an Apply. Use the mkApply function to maintain this invariant, rather than constructing Apply directly.

The Maybe VNames are existential sizes generated by this argument. May have duplicates across the program, but they will all produce the same value (the expressions will be identical).

Range (ExpBase f vn) (Maybe (ExpBase f vn)) (Inclusiveness (ExpBase f vn)) SrcLoc 
LetPat [SizeBinder vn] (PatBase f vn StructType) (ExpBase f vn) (ExpBase f vn) SrcLoc 
LetFun vn ([TypeParamBase vn], [PatBase f vn ParamType], Maybe (TypeExp (ExpBase f vn) vn), f ResRetType, ExpBase f vn) (ExpBase f vn) SrcLoc 
If (ExpBase f vn) (ExpBase f vn) (ExpBase f vn) SrcLoc 
Loop [VName] (PatBase f vn ParamType) (ExpBase f vn) (LoopFormBase f vn) (ExpBase f vn) SrcLoc 
BinOp (QualName vn, SrcLoc) (f StructType) (ExpBase f vn, f (Maybe VName)) (ExpBase f vn, f (Maybe VName)) SrcLoc 
LetWith (IdentBase f vn StructType) (IdentBase f vn StructType) (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 :: Type -> Type) 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 :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (AppExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (AppExpBase (NoInfo :: Type -> Type) 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

pretty :: AppExpBase f vn -> Doc ann #

prettyList :: [AppExpBase f vn] -> Doc ann #

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 StructType) SrcLoc

A polymorphic integral literal.

FloatLit Double (f StructType) SrcLoc

A polymorphic decimal literal.

StringLit [Word8] SrcLoc

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

Hole (f StructType) SrcLoc 
Var (QualName vn) (f StructType) 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 StructType) 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 StructType) 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 Text) 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 StructType) 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 StructType) SrcLoc 
Lambda [PatBase f vn ParamType] (ExpBase f vn) (Maybe (TypeExp (ExpBase f vn) vn)) (f ResRetType) SrcLoc 
OpSection (QualName vn) (f StructType) SrcLoc

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

OpSectionLeft (QualName vn) (f StructType) (ExpBase f vn) (f (PName, ParamType, Maybe VName), f (PName, ParamType)) (f ResRetType, f [VName]) SrcLoc

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

OpSectionRight (QualName vn) (f StructType) (ExpBase f vn) (f (PName, ParamType), f (PName, ParamType, Maybe VName)) (f ResRetType) SrcLoc

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

ProjectSection [Name] (f StructType) SrcLoc

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

IndexSection (SliceBase f vn) (f StructType) SrcLoc

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

Ascript (ExpBase f vn) (TypeExp (ExpBase f vn) vn) SrcLoc

Type ascription: e : t.

Coerce (ExpBase f vn) (TypeExp (ExpBase f vn) vn) (f StructType) SrcLoc

Size coercion: e :> t.

AppExp (AppExpBase f vn) (f AppRes) 

Instances

Instances details
ASTMappable ParamType Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

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

ASTMappable ResRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable StructType Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable Exp Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Methods

applySubst :: TypeSubs -> Exp -> Exp Source #

Substitutable ParamType Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable StructType Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

ASTMappable (SizeExp (ExpBase Info VName)) Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable (Pat ParamType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (Pat StructType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Pretty (Shape Size) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: Shape Size -> Doc ann #

prettyList :: [Shape Size] -> Doc ann #

Pretty (TypeArg Size) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: TypeArg Size -> Doc ann #

prettyList :: [TypeArg Size] -> Doc ann #

Show (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

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

Defined in Language.Futhark.Syntax

ASTMappable (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (TypeArgExp (ExpBase Info VName) VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (TypeExp (ExpBase Info VName) VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable (RetTypeBase Size NoUniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (RetTypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Eq (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (ExpBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (ExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (ExpBase (NoInfo :: Type -> Type) 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

pretty :: ExpBase f vn -> Doc ann #

prettyList :: [ExpBase f vn] -> Doc ann #

Located (ExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: ExpBase f vn -> Loc #

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

ASTMappable (PatBase Info VName ParamType) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (PatBase Info VName StructType) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (IdentBase Info VName StructType) Source # 
Instance details

Defined in Language.Futhark.Traversals

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 :: Type -> Type) 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 :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (FieldBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (FieldBase (NoInfo :: Type -> Type) 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

pretty :: FieldBase f vn -> Doc ann #

prettyList :: [FieldBase f vn] -> Doc ann #

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 StructType) (ExpBase f vn) SrcLoc 

Instances

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

Defined in Language.Futhark.Syntax

Show vn => Show (CaseBase (NoInfo :: Type -> Type) 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 :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (CaseBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (CaseBase (NoInfo :: Type -> Type) 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

pretty :: CaseBase f vn -> Doc ann #

prettyList :: [CaseBase f vn] -> Doc ann #

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 StructType) (ExpBase f vn) 
ForIn (PatBase f vn StructType) (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 :: Type -> Type) 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 :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (LoopFormBase (NoInfo :: Type -> Type) 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

pretty :: LoopFormBase f vn -> Doc ann #

prettyList :: [LoopFormBase f vn] -> Doc ann #

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

pretty :: PatLit -> Doc ann #

prettyList :: [PatLit] -> Doc ann #

data PatBase f vn t Source #

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

Constructors

TuplePat [PatBase f vn t] SrcLoc 
RecordPat [(Name, PatBase f vn t)] SrcLoc 
PatParens (PatBase f vn t) SrcLoc 
Id vn (f t) SrcLoc 
Wildcard (f t) SrcLoc 
PatAscription (PatBase f vn t) (TypeExp (ExpBase f vn) vn) SrcLoc 
PatLit PatLit (f t) SrcLoc 
PatConstr Name (f t) [PatBase f vn t] SrcLoc 
PatAttr (AttrInfo vn) (PatBase f vn t) SrcLoc 

Instances

Instances details
Substitutable (Pat ParamType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (Pat StructType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Traversable f => Foldable (PatBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fold :: Monoid m => PatBase f vn m -> m #

foldMap :: Monoid m => (a -> m) -> PatBase f vn a -> m #

foldMap' :: Monoid m => (a -> m) -> PatBase f vn a -> m #

foldr :: (a -> b -> b) -> b -> PatBase f vn a -> b #

foldr' :: (a -> b -> b) -> b -> PatBase f vn a -> b #

foldl :: (b -> a -> b) -> b -> PatBase f vn a -> b #

foldl' :: (b -> a -> b) -> b -> PatBase f vn a -> b #

foldr1 :: (a -> a -> a) -> PatBase f vn a -> a #

foldl1 :: (a -> a -> a) -> PatBase f vn a -> a #

toList :: PatBase f vn a -> [a] #

null :: PatBase f vn a -> Bool #

length :: PatBase f vn a -> Int #

elem :: Eq a => a -> PatBase f vn a -> Bool #

maximum :: Ord a => PatBase f vn a -> a #

minimum :: Ord a => PatBase f vn a -> a #

sum :: Num a => PatBase f vn a -> a #

product :: Num a => PatBase f vn a -> a #

Traversable f => Traversable (PatBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

traverse :: Applicative f0 => (a -> f0 b) -> PatBase f vn a -> f0 (PatBase f vn b) #

sequenceA :: Applicative f0 => PatBase f vn (f0 a) -> f0 (PatBase f vn a) #

mapM :: Monad m => (a -> m b) -> PatBase f vn a -> m (PatBase f vn b) #

sequence :: Monad m => PatBase f vn (m a) -> m (PatBase f vn a) #

Traversable f => Functor (PatBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

fmap :: (a -> b) -> PatBase f vn a -> PatBase f vn b #

(<$) :: a -> PatBase f vn b -> PatBase f vn a #

Show (Info t) => Show (PatBase Info VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Show (NoInfo t), Show vn) => Show (PatBase (NoInfo :: Type -> Type) vn t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> PatBase NoInfo vn t -> ShowS #

show :: PatBase NoInfo vn t -> String #

showList :: [PatBase NoInfo vn t] -> ShowS #

ASTMappable (PatBase Info VName ParamType) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (PatBase Info VName StructType) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (Info t) => Eq (PatBase Info VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (NoInfo t) => Eq (PatBase (NoInfo :: Type -> Type) VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (Info t) => Ord (PatBase Info VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (NoInfo t) => Ord (PatBase (NoInfo :: Type -> Type) VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

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

Defined in Language.Futhark.Pretty

Methods

pretty :: PatBase f vn t -> Doc ann #

prettyList :: [PatBase f vn t] -> Doc ann #

Located (PatBase f vn t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: PatBase f vn t -> Loc #

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

Module language

newtype ImportName Source #

Canonical reference to a Futhark code file. Does not include the .fut extension. This is most often a path relative to the working directory of the compiler. In a multi-file program, a file is known by exactly one import name, even if it is referenced relatively by different names by files in different subdirectories.

Constructors

ImportName FilePath 

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 :: Type -> Type) 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

pretty :: SpecBase f vn -> Doc ann #

prettyList :: [SpecBase f vn] -> Doc ann #

Located (SpecBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: SpecBase f vn -> Loc #

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

data ModTypeExpBase f vn Source #

A module type expression.

Instances

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

Defined in Language.Futhark.Syntax

Show (ModTypeExpBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

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

Defined in Language.Futhark.Pretty

Methods

pretty :: ModTypeExpBase f vn -> Doc ann #

prettyList :: [ModTypeExpBase f vn] -> Doc ann #

Located (ModTypeExpBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: ModTypeExpBase f vn -> Loc #

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

data TypeRefBase f vn Source #

A type refinement.

Constructors

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

Instances

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

Defined in Language.Futhark.Syntax

Show (TypeRefBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Located (TypeRefBase f vn) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

locOf :: TypeRefBase f vn -> Loc #

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

data ModTypeBindBase f vn Source #

Module type binding.

data ModExpBase f vn Source #

Module expression.

Constructors

ModVar (QualName vn) SrcLoc 
ModParens (ModExpBase f vn) SrcLoc 
ModImport FilePath (f ImportName) 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) (ModTypeExpBase f vn) (f (Map VName VName)) SrcLoc 
ModLambda (ModParamBase f vn) (Maybe (ModTypeExpBase 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 :: Type -> Type) 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

pretty :: ModExpBase f vn -> Doc ann #

prettyList :: [ModExpBase f vn] -> Doc ann #

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 :: Type -> Type) 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

pretty :: ModBindBase f vn -> Doc ann #

prettyList :: [ModBindBase f vn] -> Doc ann #

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.

Instances

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

Defined in Language.Futhark.Syntax

Show (ModParamBase (NoInfo :: Type -> Type) 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

pretty :: ModParamBase f vn -> Doc ann #

prettyList :: [ModParamBase f vn] -> Doc ann #

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. The string may contain newline characters, but it does not contain comment prefix markers.

Constructors

DocComment Text 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 :: Type -> Type) 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

pretty :: ValBindBase f vn -> Doc ann #

prettyList :: [ValBindBase f vn] -> Doc ann #

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. Note that although size expressions in the elaborated type can contain variables, they are no longer in scope, and are considered more like equivalence classes.

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 :: Type -> Type) 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

pretty :: TypeBindBase f vn -> Doc ann #

prettyList :: [TypeBindBase f vn] -> Doc ann #

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

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

pretty :: TypeParamBase vn -> Doc ann #

prettyList :: [TypeParamBase vn] -> Doc ann #

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 :: Type -> Type) 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

pretty :: ProgBase f vn -> Doc ann #

prettyList :: [ProgBase f vn] -> Doc ann #

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 :: Type -> Type) 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

pretty :: DecBase f vn -> Doc ann #

prettyList :: [DecBase f vn] -> Doc ann #

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 :: Type -> Type) 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 :: Type -> Type) 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 :: Type -> Type) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Annot (NoInfo :: Type -> Type) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

unAnnot :: NoInfo a -> Maybe a Source #

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

Defined in Language.Futhark.Syntax

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

Defined in Language.Futhark.Syntax

Show (DecBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

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

Defined in Language.Futhark.Syntax

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

Defined in Language.Futhark.Syntax

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

Defined in Language.Futhark.Syntax

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

Defined in Language.Futhark.Syntax

Show (ModBindBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModExpBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModParamBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModTypeBindBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModTypeExpBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

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 #

Show (ProgBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (SpecBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (TypeBindBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (TypeRefBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ValBindBase (NoInfo :: Type -> Type) Name) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (AppExpBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (CaseBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (DimIndexBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (ExpBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (FieldBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (LoopFormBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Eq (NoInfo a) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

Ord (AppExpBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (CaseBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (DimIndexBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (ExpBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (FieldBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (LoopFormBase (NoInfo :: Type -> Type) VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

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 (NoInfo t), Show vn) => Show (PatBase (NoInfo :: Type -> Type) vn t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

showsPrec :: Int -> PatBase NoInfo vn t -> ShowS #

show :: PatBase NoInfo vn t -> String #

showList :: [PatBase NoInfo vn t] -> ShowS #

Eq (NoInfo t) => Eq (PatBase (NoInfo :: Type -> Type) VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (NoInfo t) => Ord (PatBase (NoInfo :: Type -> Type) VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

(Show (Info t), Show vn) => Show (IdentBase (NoInfo :: Type -> Type) vn t) 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 #

ASTMappable ParamType Source # 
Instance details

Defined in Language.Futhark.Traversals

Methods

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

ASTMappable ResRetType Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable StructType Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable Exp Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Methods

applySubst :: TypeSubs -> Exp -> Exp Source #

Substitutable ParamType Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable StructType Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

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 #

ASTMappable (SizeExp (ExpBase Info VName)) Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable (Pat ParamType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (Pat StructType) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

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 #

Pretty (Shape Size) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: Shape Size -> Doc ann #

prettyList :: [Shape Size] -> Doc ann #

Pretty (TypeArg Size) Source # 
Instance details

Defined in Language.Futhark.Pretty

Methods

pretty :: TypeArg Size -> Doc ann #

prettyList :: [TypeArg Size] -> Doc ann #

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 (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 (ModTypeBindBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ModTypeExpBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (ProgBase 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 (TypeRefBase 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 (LoopFormBase Info VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (TypeArgExp (ExpBase Info VName) VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (TypeExp (ExpBase Info VName) VName) Source # 
Instance details

Defined in Language.Futhark.Traversals

Substitutable (RetTypeBase Size NoUniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (RetTypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

Substitutable (TypeBase Size Uniqueness) Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Types

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

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

Show (Info t) => Show (PatBase Info VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (PatBase Info VName ParamType) Source # 
Instance details

Defined in Language.Futhark.Traversals

ASTMappable (PatBase Info VName StructType) Source # 
Instance details

Defined in Language.Futhark.Traversals

Eq (Info t) => Eq (PatBase Info VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Ord (Info t) => Ord (PatBase Info VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

Show (Info t) => Show (IdentBase Info VName t) Source # 
Instance details

Defined in Language.Futhark.Syntax

ASTMappable (IdentBase Info VName StructType) Source # 
Instance details

Defined in Language.Futhark.Traversals

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 #

Eq v => Eq (QualName v) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

(==) :: QualName v -> QualName v -> Bool #

(/=) :: QualName v -> QualName v -> Bool #

Ord v => Ord (QualName v) Source # 
Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: QualName v -> QualName v -> Ordering #

(<) :: QualName v -> QualName v -> Bool #

(<=) :: QualName v -> QualName v -> Bool #

(>) :: QualName v -> QualName v -> Bool #

(>=) :: QualName v -> QualName v -> Bool #

max :: QualName v -> QualName v -> QualName v #

min :: QualName v -> QualName v -> QualName v #

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

Defined in Language.Futhark.Pretty

Methods

pretty :: QualName vn -> Doc ann #

prettyList :: [QualName vn] -> Doc ann #

mkApply :: ExpBase Info vn -> [(Maybe VName, ExpBase Info vn)] -> AppRes -> ExpBase Info vn Source #

Construct an Apply node, with type information.

mkApplyUT :: ExpBase NoInfo vn -> ExpBase NoInfo vn -> ExpBase NoInfo vn Source #

Construct an Apply node, without type information.

sizeFromName :: QualName VName -> SrcLoc -> Size Source #

Create a Size from a name.

sizeFromInteger :: Integer -> SrcLoc -> Size Source #

Create a Size from a constant integer.