| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- module Language.Futhark.Core
- prettyString :: Pretty a => a -> String
- prettyText :: Pretty a => a -> Text
- data Uniqueness
- data IntType
- data FloatType
- data PrimType
- type Size = ExpBase Info VName
- newtype Shape dim = Shape {
- shapeDims :: [dim]
- shapeRank :: Shape dim -> Int
- stripDims :: Int -> Shape dim -> Maybe (Shape dim)
- data TypeBase dim u
- = Scalar (ScalarTypeBase dim u)
- | Array u (Shape dim) (ScalarTypeBase dim NoUniqueness)
- data TypeArg dim
- = TypeArgDim dim
- | TypeArgType (TypeBase dim NoUniqueness)
- data SizeExp d
- = SizeExp d SrcLoc
- | SizeExpAny SrcLoc
- data TypeExp d vn
- = TEVar (QualName vn) SrcLoc
- | TEParens (TypeExp d vn) SrcLoc
- | TETuple [TypeExp d vn] SrcLoc
- | TERecord [(L 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
- data TypeArgExp d vn
- = TypeArgExpSize (SizeExp d)
- | TypeArgExpType (TypeExp d vn)
- data PName
- data ScalarTypeBase dim u
- data RetTypeBase dim as = RetType {}
- type StructType = TypeBase Size NoUniqueness
- type ParamType = TypeBase Size Diet
- type ResType = TypeBase Size Uniqueness
- type StructRetType = RetTypeBase Size NoUniqueness
- type ResRetType = RetTypeBase Size Uniqueness
- type ValueType = TypeBase Int64 NoUniqueness
- data Diet
- data IntValue
- = Int8Value !Int8
- | Int16Value !Int16
- | Int32Value !Int32
- | Int64Value !Int64
- data FloatValue
- = Float16Value !Half
- | Float32Value !Float
- | Float64Value !Double
- data PrimValue
- = SignedValue !IntValue
- | UnsignedValue !IntValue
- | FloatValue !FloatValue
- | BoolValue !Bool
- class IsPrimValue v where
- data AttrInfo (vn :: k)
- data AttrAtom (vn :: k)
- data BinOp
- data IdentBase (f :: k -> Type) vn (t :: k) = Ident {
- identName :: vn
- identType :: f t
- identSrcLoc :: SrcLoc
- data Inclusiveness a
- = DownToExclusive a
- | ToInclusive a
- | UpToExclusive a
- data DimIndexBase (f :: Type -> Type) vn
- type SliceBase (f :: Type -> Type) vn = [DimIndexBase f vn]
- data SizeBinder vn = SizeBinder {}
- data AppExpBase (f :: Type -> Type) vn
- = Apply (ExpBase f vn) (NonEmpty (f (Maybe VName), ExpBase f vn)) SrcLoc
- | 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) (LoopInitBase 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
- data AppRes = AppRes {
- appResType :: StructType
- appResExt :: [VName]
- data ExpBase (f :: Type -> Type) vn
- = Literal PrimValue SrcLoc
- | IntLit Integer (f StructType) SrcLoc
- | FloatLit Double (f StructType) SrcLoc
- | StringLit [Word8] SrcLoc
- | Hole (f StructType) SrcLoc
- | Var (QualName vn) (f StructType) SrcLoc
- | Parens (ExpBase f vn) SrcLoc
- | QualParens (QualName vn, SrcLoc) (ExpBase f vn) SrcLoc
- | TupLit [ExpBase f vn] SrcLoc
- | RecordLit [FieldBase f vn] SrcLoc
- | ArrayLit [ExpBase f vn] (f StructType) SrcLoc
- | ArrayVal [PrimValue] PrimType SrcLoc
- | Attr (AttrInfo vn) (ExpBase f vn) SrcLoc
- | Project Name (ExpBase f vn) (f StructType) SrcLoc
- | Negate (ExpBase f vn) SrcLoc
- | Not (ExpBase f vn) SrcLoc
- | Assert (ExpBase f vn) (ExpBase f vn) (f Text) SrcLoc
- | Constr Name [ExpBase f vn] (f StructType) SrcLoc
- | 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
- | OpSectionLeft (QualName vn) (f StructType) (ExpBase f vn) (f (PName, ParamType, Maybe VName), f (PName, ParamType)) (f ResRetType, f [VName]) SrcLoc
- | OpSectionRight (QualName vn) (f StructType) (ExpBase f vn) (f (PName, ParamType), f (PName, ParamType, Maybe VName)) (f ResRetType) SrcLoc
- | ProjectSection [Name] (f StructType) SrcLoc
- | IndexSection (SliceBase f vn) (f StructType) SrcLoc
- | Ascript (ExpBase f vn) (TypeExp (ExpBase f vn) vn) SrcLoc
- | Coerce (ExpBase f vn) (TypeExp (ExpBase f vn) vn) (f StructType) SrcLoc
- | AppExp (AppExpBase f vn) (f AppRes)
- data FieldBase (f :: Type -> Type) vn
- = RecordFieldExplicit (L Name) (ExpBase f vn) SrcLoc
- | RecordFieldImplicit (L vn) (f StructType) SrcLoc
- data CaseBase (f :: Type -> Type) vn = CasePat (PatBase f vn StructType) (ExpBase f vn) SrcLoc
- data LoopInitBase (f :: Type -> Type) vn
- = LoopInitExplicit (ExpBase f vn)
- | LoopInitImplicit (f (ExpBase f vn))
- data LoopFormBase (f :: Type -> Type) vn
- = For (IdentBase f vn StructType) (ExpBase f vn)
- | ForIn (PatBase f vn StructType) (ExpBase f vn)
- | While (ExpBase f vn)
- data PatLit
- = PatLitInt Integer
- | PatLitFloat Double
- | PatLitPrim PrimValue
- data PatBase (f :: Type -> Type) vn t
- = TuplePat [PatBase f vn t] SrcLoc
- | RecordPat [(L 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
- newtype ImportName = ImportName FilePath
- data SpecBase (f :: Type -> Type) vn
- = ValSpec {
- specName :: vn
- specTypeParams :: [TypeParamBase vn]
- specTypeExp :: TypeExp (ExpBase f vn) vn
- specType :: f StructType
- specDoc :: Maybe DocComment
- specLocation :: SrcLoc
- | TypeAbbrSpec (TypeBindBase f vn)
- | TypeSpec Liftedness vn [TypeParamBase vn] (Maybe DocComment) SrcLoc
- | ModSpec vn (ModTypeExpBase f vn) (Maybe DocComment) SrcLoc
- | IncludeSpec (ModTypeExpBase f vn) SrcLoc
- = ValSpec {
- data ModTypeExpBase (f :: Type -> Type) vn
- = ModTypeVar (QualName vn) (f (Map VName VName)) SrcLoc
- | ModTypeParens (ModTypeExpBase f vn) SrcLoc
- | ModTypeSpecs [SpecBase f vn] SrcLoc
- | ModTypeWith (ModTypeExpBase f vn) (TypeRefBase f vn) SrcLoc
- | ModTypeArrow (Maybe vn) (ModTypeExpBase f vn) (ModTypeExpBase f vn) SrcLoc
- data TypeRefBase (f :: Type -> Type) vn = TypeRef (QualName vn) [TypeParamBase vn] (TypeExp (ExpBase f vn) vn) SrcLoc
- data ModTypeBindBase (f :: Type -> Type) vn = ModTypeBind {
- modTypeName :: vn
- modTypeExp :: ModTypeExpBase f vn
- modTypeDoc :: Maybe DocComment
- modTypeLoc :: SrcLoc
- data ModExpBase (f :: Type -> Type) vn
- = ModVar (QualName vn) SrcLoc
- | ModParens (ModExpBase f vn) SrcLoc
- | ModImport FilePath (f ImportName) SrcLoc
- | ModDecs [DecBase f vn] SrcLoc
- | ModApply (ModExpBase f vn) (ModExpBase f vn) (f (Map VName VName)) (f (Map VName VName)) SrcLoc
- | 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
- data ModBindBase (f :: Type -> Type) vn = ModBind {
- modName :: vn
- modParams :: [ModParamBase f vn]
- modType :: Maybe (ModTypeExpBase f vn, f (Map VName VName))
- modExp :: ModExpBase f vn
- modDoc :: Maybe DocComment
- modLocation :: SrcLoc
- data ModParamBase (f :: Type -> Type) vn = ModParam {
- modParamName :: vn
- modParamType :: ModTypeExpBase f vn
- modParamAbs :: f [VName]
- modParamLocation :: SrcLoc
- data DocComment = DocComment Text SrcLoc
- data ValBindBase (f :: Type -> Type) vn = ValBind {
- valBindEntryPoint :: Maybe (f EntryPoint)
- valBindName :: vn
- valBindRetDecl :: Maybe (TypeExp (ExpBase f vn) vn)
- valBindRetType :: f ResRetType
- valBindTypeParams :: [TypeParamBase vn]
- valBindParams :: [PatBase f vn ParamType]
- valBindBody :: ExpBase f vn
- valBindDoc :: Maybe DocComment
- valBindAttrs :: [AttrInfo vn]
- valBindLocation :: SrcLoc
- data EntryPoint = EntryPoint {}
- data EntryType = EntryType {
- entryType :: StructType
- entryAscribed :: Maybe (TypeExp (ExpBase Info VName) VName)
- data EntryParam = EntryParam {}
- data Liftedness
- = Unlifted
- | SizeLifted
- | Lifted
- data TypeBindBase (f :: Type -> Type) vn = TypeBind {
- typeAlias :: vn
- typeLiftedness :: Liftedness
- typeParams :: [TypeParamBase vn]
- typeExp :: TypeExp (ExpBase f vn) vn
- typeElab :: f StructRetType
- typeDoc :: Maybe DocComment
- typeBindLocation :: SrcLoc
- data TypeParamBase vn
- = TypeParamDim vn SrcLoc
- | TypeParamType Liftedness vn SrcLoc
- typeParamName :: TypeParamBase vn -> vn
- data ProgBase (f :: Type -> Type) vn = Prog {
- progDoc :: Maybe DocComment
- progDecs :: [DecBase f vn]
- data DecBase (f :: Type -> Type) vn
- = ValDec (ValBindBase f vn)
- | TypeDec (TypeBindBase f vn)
- | ModTypeDec (ModTypeBindBase f vn)
- | ModDec (ModBindBase f vn)
- | OpenDec (ModExpBase f vn) SrcLoc
- | LocalDec (DecBase f vn) SrcLoc
- | ImportDec FilePath (f ImportName) SrcLoc
- data L a = L Loc a
- data NoInfo (a :: k) = NoInfo
- newtype Info a = Info {
- unInfo :: a
- data QualName vn = QualName {}
- mkApply :: ExpBase Info vn -> [(Maybe VName, ExpBase Info vn)] -> AppRes -> ExpBase Info vn
- mkApplyUT :: ExpBase (NoInfo :: Type -> Type) vn -> ExpBase (NoInfo :: Type -> Type) vn -> ExpBase (NoInfo :: Type -> Type) vn
- sizeFromName :: QualName VName -> SrcLoc -> Size
- sizeFromInteger :: Integer -> SrcLoc -> Size
- loopInitExp :: LoopInitBase Info VName -> ExpBase Info VName
Documentation
module Language.Futhark.Core
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
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.
A floating point type.
Instances
| Bounded FloatType Source # | |
Defined in Language.Futhark.Primitive | |
| Enum FloatType Source # | |
Defined in Language.Futhark.Primitive | |
| Show FloatType Source # | |
| Eq FloatType Source # | |
| Ord FloatType Source # | |
Defined in Language.Futhark.Primitive | |
| Pretty FloatType Source # | |
Low-level primitive types.
The size of an array type is a list of its dimension sizes. If
Nothing, that dimension is of a (statically) unknown size.
Instances
| Functor Shape Source # | |
| Foldable Shape Source # | |
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 elem :: Eq a => a -> Shape a -> Bool maximum :: Ord a => Shape a -> a | |
| Traversable Shape Source # | |
| Substitutable d => Substitutable (Shape d) Source # | |
Defined in Language.Futhark.TypeChecker.Types | |
| Monoid (Shape dim) Source # | |
| Semigroup (Shape dim) Source # | |
| Show dim => Show (Shape dim) Source # | |
| Eq dim => Eq (Shape dim) Source # | |
| Ord dim => Ord (Shape dim) Source # | |
Defined in Language.Futhark.Syntax | |
| Pretty (Shape Size) Source # | |
| Pretty (Shape Int64) Source # | |
| Pretty (Shape ()) Source # | |
| Pretty (Shape Bool) Source # | |
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.
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
An argument passed to a type constructor.
Constructors
| TypeArgDim dim | |
| TypeArgType (TypeBase dim NoUniqueness) |
Instances
| Functor TypeArg Source # | |
| Foldable TypeArg Source # | |
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 elem :: Eq a => a -> TypeArg a -> Bool maximum :: Ord a => TypeArg a -> a minimum :: Ord a => TypeArg a -> a | |
| Traversable TypeArg Source # | |
| Show dim => Show (TypeArg dim) Source # | |
| Eq dim => Eq (TypeArg dim) Source # | |
| Ord dim => Ord (TypeArg dim) Source # | |
Defined in Language.Futhark.Syntax | |
| Pretty (TypeArg Size) 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
| Functor SizeExp Source # | |
| Foldable SizeExp Source # | |
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 elem :: Eq a => a -> SizeExp a -> Bool maximum :: Ord a => SizeExp a -> a minimum :: Ord a => SizeExp a -> a | |
| Traversable SizeExp Source # | |
| ASTMappable (SizeExp (ExpBase Info VName)) Source # | |
| Show d => Show (SizeExp d) Source # | |
| Eq d => Eq (SizeExp d) Source # | |
| Ord d => Ord (SizeExp d) Source # | |
Defined in Language.Futhark.Syntax | |
| Pretty d => Pretty (SizeExp d) Source # | |
| Located (SizeExp d) 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 [(L 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
| Bifoldable TypeExp Source # | |
| Bifunctor TypeExp Source # | |
| Bitraversable TypeExp Source # | |
Defined in Language.Futhark.Syntax Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> TypeExp a b -> f (TypeExp c d) | |
| Functor (TypeExp d) Source # | |
| Foldable (TypeExp dim) Source # | |
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] 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 | |
| Traversable (TypeExp dim) Source # | |
Defined in Language.Futhark.Syntax | |
| ASTMappable (TypeExp (ExpBase Info VName) VName) Source # | |
| (Show vn, Show d) => Show (TypeExp d vn) Source # | |
| (Eq vn, Eq d) => Eq (TypeExp d vn) Source # | |
| (Ord vn, Ord d) => Ord (TypeExp d vn) Source # | |
Defined in Language.Futhark.Syntax | |
| (IsName vn, Pretty d) => Pretty (TypeExp d vn) Source # | |
| Located (TypeExp f vn) Source # | |
data TypeArgExp d vn Source #
A type argument expression passed to a type constructor.
Constructors
| TypeArgExpSize (SizeExp d) | |
| TypeArgExpType (TypeExp d vn) |
Instances
| Bifoldable TypeArgExp Source # | |
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 # | |
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 # | |
Defined in Language.Futhark.Syntax Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> TypeArgExp a b -> f (TypeArgExp c d) | |
| Functor (TypeArgExp d) Source # | |
Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> TypeArgExp d a -> TypeArgExp d b (<$) :: a -> TypeArgExp d b -> TypeArgExp d a | |
| Foldable (TypeArgExp d) Source # | |
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 # | |
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) | |
| ASTMappable (TypeArgExp (ExpBase Info VName) VName) Source # | |
Defined in Language.Futhark.Traversals | |
| (Show d, Show vn) => Show (TypeArgExp d vn) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeArgExp d vn -> ShowS show :: TypeArgExp d vn -> String showList :: [TypeArgExp d vn] -> ShowS | |
| (Eq d, Eq vn) => Eq (TypeArgExp d vn) Source # | |
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 # | |
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 # | |
Defined in Language.Futhark.Pretty Methods pretty :: TypeArgExp d vn -> Doc ann Source # prettyList :: [TypeArgExp d vn] -> Doc ann Source # | |
| Located (TypeArgExp f vn) Source # | |
Defined in Language.Futhark.Syntax | |
The name (if any) of a function parameter. The Eq and Ord
instances always compare values of this type equal.
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
| Bifoldable ScalarTypeBase Source # | |
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 # | |
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 # | |
Defined in Language.Futhark.Syntax Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> ScalarTypeBase a b -> f (ScalarTypeBase c d) | |
| Functor (ScalarTypeBase dim) Source # | |
Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> ScalarTypeBase dim a -> ScalarTypeBase dim b (<$) :: a -> ScalarTypeBase dim b -> ScalarTypeBase dim a | |
| Foldable (ScalarTypeBase dim) Source # | |
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 # | |
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) | |
| (Show dim, Show u) => Show (ScalarTypeBase dim u) Source # | |
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 # | |
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 # | |
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 # | |
Defined in Language.Futhark.Pretty Methods pretty :: ScalarTypeBase dim u -> Doc ann Source # prettyList :: [ScalarTypeBase dim u] -> Doc ann Source # | |
data RetTypeBase dim as Source #
Types that can appear to the right of a function arrow. This just means they can be existentially quantified.
Instances
| Bifoldable RetTypeBase Source # | |
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 # | |
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 # | |
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 # | |
Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> ResRetType -> m ResRetType Source # | |
| Functor (RetTypeBase dim) Source # | |
Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> RetTypeBase dim a -> RetTypeBase dim b (<$) :: a -> RetTypeBase dim b -> RetTypeBase dim a | |
| Foldable (RetTypeBase dim) Source # | |
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 # | |
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) | |
| Substitutable (RetTypeBase Size NoUniqueness) Source # | |
Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size NoUniqueness -> RetTypeBase Size NoUniqueness Source # | |
| Substitutable (RetTypeBase Size Uniqueness) Source # | |
Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size Uniqueness -> RetTypeBase Size Uniqueness Source # | |
| (Show as, Show dim) => Show (RetTypeBase dim as) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> RetTypeBase dim as -> ShowS show :: RetTypeBase dim as -> String showList :: [RetTypeBase dim as] -> ShowS | |
| (Eq as, Eq dim) => Eq (RetTypeBase dim as) Source # | |
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 # | |
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 # | |
Defined in Language.Futhark.Pretty Methods pretty :: RetTypeBase dim u -> Doc ann Source # prettyList :: [RetTypeBase dim u] -> Doc ann Source # | |
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.
Information about which parts of a parameter are consumed. This can be considered kind of an effect on the function.
Instances
| ASTMappable ParamType Source # | |
| Substitutable ParamType Source # | |
Defined in Language.Futhark.TypeChecker.Types | |
| Monoid Diet Source # | |
| Semigroup Diet Source # | |
| Show Diet Source # | |
| Eq Diet Source # | |
| Ord Diet Source # | |
| Pretty Diet Source # | |
| Substitutable (Pat ParamType) Source # | |
Defined in Language.Futhark.TypeChecker.Types | |
| ASTMappable (PatBase Info VName ParamType) Source # | |
Values
An integer value.
Constructors
| Int8Value !Int8 | |
| Int16Value !Int16 | |
| Int32Value !Int32 | |
| Int64Value !Int64 |
data FloatValue Source #
A floating-point value.
Constructors
| Float16Value !Half | |
| Float32Value !Float | |
| Float64Value !Double |
Instances
| IsValue FloatValue Source # | |
Defined in Futhark.IR.Prop.Constants Methods value :: FloatValue -> PrimValue Source # | |
| Show FloatValue Source # | |
Defined in Language.Futhark.Primitive Methods showsPrec :: Int -> FloatValue -> ShowS show :: FloatValue -> String showList :: [FloatValue] -> ShowS | |
| Eq FloatValue Source # | |
Defined in Language.Futhark.Primitive | |
| Ord FloatValue Source # | |
Defined in Language.Futhark.Primitive Methods compare :: FloatValue -> FloatValue -> Ordering (<) :: FloatValue -> FloatValue -> Bool (<=) :: FloatValue -> FloatValue -> Bool (>) :: FloatValue -> FloatValue -> Bool (>=) :: FloatValue -> FloatValue -> Bool max :: FloatValue -> FloatValue -> FloatValue min :: FloatValue -> FloatValue -> FloatValue | |
| ToExp FloatValue Source # | |
Defined in Futhark.CodeGen.Backends.SimpleRep | |
| Pretty FloatValue Source # | |
Defined in Language.Futhark.Primitive | |
Non-array values.
Constructors
| SignedValue !IntValue | |
| UnsignedValue !IntValue | |
| FloatValue !FloatValue | |
| BoolValue !Bool |
class IsPrimValue v where Source #
A class for converting ordinary Haskell values to primitive Futhark values.
Instances
| IsPrimValue Int16 Source # | |
| IsPrimValue Int32 Source # | |
| IsPrimValue Int64 Source # | |
| IsPrimValue Int8 Source # | |
| IsPrimValue Word16 Source # | |
| IsPrimValue Word32 Source # | |
| IsPrimValue Word64 Source # | |
| IsPrimValue Word8 Source # | |
| IsPrimValue Bool Source # | |
Defined in Language.Futhark.Syntax | |
| IsPrimValue Double Source # | |
Defined in Language.Futhark.Syntax | |
| IsPrimValue Float Source # | |
Defined in Language.Futhark.Syntax | |
| IsPrimValue Int Source # | |
Abstract syntax tree
data AttrInfo (vn :: k) Source #
The payload of an attribute.
Instances
| Show (AttrInfo vn) Source # | |
| Eq (AttrInfo vn) Source # | |
| Ord (AttrInfo vn) Source # | |
Defined in Language.Futhark.Syntax | |
| IsName vn => Pretty (AttrInfo vn) Source # | |
data AttrAtom (vn :: k) Source #
The value of an AttrAtom.
Instances
| Show (AttrAtom vn) Source # | |
| Eq (AttrAtom vn) Source # | |
| Ord (AttrAtom vn) Source # | |
Defined in Language.Futhark.Syntax | |
| IsName vn => Pretty (AttrAtom vn) 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 |
|
data IdentBase (f :: k -> Type) vn (t :: k) Source #
An identifier consists of its name and the type of the value bound to the identifier.
Constructors
| Ident | |
Fields
| |
Instances
| ASTMappable (IdentBase Info VName StructType) Source # | |
Defined in Language.Futhark.Traversals | |
| Show (Info t) => Show (IdentBase Info VName t) Source # | |
| (Show (Info t), Show vn) => Show (IdentBase (NoInfo :: Type -> Type) vn t) Source # | |
| Eq vn => Eq (IdentBase ty vn t) Source # | |
| Ord vn => Ord (IdentBase ty vn t) Source # | |
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 # | |
| Located (IdentBase ty vn t) Source # | |
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
data DimIndexBase (f :: Type -> Type) 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
type SliceBase (f :: Type -> Type) 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 | |
Instances
| Show vn => Show (SizeBinder vn) Source # | |
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 # | |
Defined in Language.Futhark.Syntax | |
| Ord vn => Ord (SizeBinder vn) Source # | |
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 # | |
Defined in Language.Futhark.Pretty | |
| Located (SizeBinder vn) Source # | |
Defined in Language.Futhark.Syntax | |
data AppExpBase (f :: Type -> Type) 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 The |
| 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) (LoopInitBase 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
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 | |
Fields
| |
data ExpBase (f :: Type -> Type) 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 ,
and the type checker will convert these to NoInfo NameExp , in
which type information is always present and all names are unique.Info VName
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., |
| RecordLit [FieldBase f vn] SrcLoc | Record literals, e.g. |
| ArrayLit [ExpBase f vn] (f StructType) SrcLoc | Array literals, e.g., |
| ArrayVal [PrimValue] PrimType SrcLoc | Array value constants, where the elements are known to be
constant primitives. This is a fast-path variant of |
| 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 |
|
| OpSectionLeft (QualName vn) (f StructType) (ExpBase f vn) (f (PName, ParamType, Maybe VName), f (PName, ParamType)) (f ResRetType, f [VName]) SrcLoc |
|
| OpSectionRight (QualName vn) (f StructType) (ExpBase f vn) (f (PName, ParamType), f (PName, ParamType, Maybe VName)) (f ResRetType) SrcLoc |
|
| ProjectSection [Name] (f StructType) SrcLoc | Field projection as a section: |
| IndexSection (SliceBase f vn) (f StructType) SrcLoc | Array indexing as a section: |
| Ascript (ExpBase f vn) (TypeExp (ExpBase f vn) vn) SrcLoc | Type ascription: |
| Coerce (ExpBase f vn) (TypeExp (ExpBase f vn) vn) (f StructType) SrcLoc | Size coercion: |
| AppExp (AppExpBase f vn) (f AppRes) |
Instances
data FieldBase (f :: Type -> Type) vn Source #
An entry in a record literal.
Constructors
| RecordFieldExplicit (L Name) (ExpBase f vn) SrcLoc | |
| RecordFieldImplicit (L vn) (f StructType) SrcLoc |
Instances
data CaseBase (f :: Type -> Type) vn Source #
A case in a match expression.
Constructors
| CasePat (PatBase f vn StructType) (ExpBase f vn) SrcLoc |
Instances
data LoopInitBase (f :: Type -> Type) vn Source #
Initial value for the loop. If none is provided, then an expression will be synthesised based on the parameter.
Constructors
| LoopInitExplicit (ExpBase f vn) | |
| LoopInitImplicit (f (ExpBase f vn)) |
Instances
data LoopFormBase (f :: Type -> Type) 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
A literal in a pattern.
Constructors
| PatLitInt Integer | |
| PatLitFloat Double | |
| PatLitPrim PrimValue |
data PatBase (f :: Type -> Type) 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 [(L 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
| Substitutable (Pat ParamType) Source # | |
Defined in Language.Futhark.TypeChecker.Types | |
| Substitutable (Pat StructType) Source # | |
Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat StructType -> Pat StructType Source # | |
| Traversable f => Functor (PatBase f vn) Source # | |
| Traversable f => Foldable (PatBase f vn) Source # | |
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 | |
| Traversable f => Traversable (PatBase f vn) Source # | |
Defined in Language.Futhark.Syntax | |
| ASTMappable (PatBase Info VName ParamType) Source # | |
| ASTMappable (PatBase Info VName StructType) Source # | |
Defined in Language.Futhark.Traversals | |
| Show (Info t) => Show (PatBase Info VName t) Source # | |
| (Show (NoInfo t), Show vn) => Show (PatBase (NoInfo :: Type -> Type) vn t) Source # | |
| Eq (Info t) => Eq (PatBase Info VName t) Source # | |
| Eq (NoInfo t) => Eq (PatBase (NoInfo :: Type -> Type) VName t) Source # | |
| Ord (Info t) => Ord (PatBase Info VName t) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: PatBase Info VName t -> PatBase Info VName t -> Ordering (<) :: PatBase Info VName t -> PatBase Info VName t -> Bool (<=) :: PatBase Info VName t -> PatBase Info VName t -> Bool (>) :: PatBase Info VName t -> PatBase Info VName t -> Bool (>=) :: PatBase Info VName t -> PatBase Info VName t -> Bool max :: PatBase Info VName t -> PatBase Info VName t -> PatBase Info VName t min :: PatBase Info VName t -> PatBase Info VName t -> PatBase Info VName t | |
| Ord (NoInfo t) => Ord (PatBase (NoInfo :: Type -> Type) VName t) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Ordering (<) :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Bool (<=) :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Bool (>) :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Bool (>=) :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Bool max :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t min :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t | |
| (IsName vn, Annot f, Pretty t) => Pretty (PatBase f vn t) Source # | |
| Located (PatBase f vn t) Source # | |
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 |
Instances
| Show ImportName Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ImportName -> ShowS show :: ImportName -> String showList :: [ImportName] -> ShowS | |
| Eq ImportName Source # | |
Defined in Language.Futhark.Syntax | |
| Ord ImportName Source # | |
Defined in Language.Futhark.Syntax Methods compare :: ImportName -> ImportName -> Ordering (<) :: ImportName -> ImportName -> Bool (<=) :: ImportName -> ImportName -> Bool (>) :: ImportName -> ImportName -> Bool (>=) :: ImportName -> ImportName -> Bool max :: ImportName -> ImportName -> ImportName min :: ImportName -> ImportName -> ImportName | |
data SpecBase (f :: Type -> Type) vn Source #
A spec is a component of a module type.
Constructors
| ValSpec | |
Fields
| |
| TypeAbbrSpec (TypeBindBase f vn) | |
| TypeSpec Liftedness vn [TypeParamBase vn] (Maybe DocComment) SrcLoc | Abstract type. |
| ModSpec vn (ModTypeExpBase f vn) (Maybe DocComment) SrcLoc | |
| IncludeSpec (ModTypeExpBase f vn) SrcLoc | |
data ModTypeExpBase (f :: Type -> Type) vn Source #
A module type expression.
Constructors
| ModTypeVar (QualName vn) (f (Map VName VName)) SrcLoc | |
| ModTypeParens (ModTypeExpBase f vn) SrcLoc | |
| ModTypeSpecs [SpecBase f vn] SrcLoc | |
| ModTypeWith (ModTypeExpBase f vn) (TypeRefBase f vn) SrcLoc | |
| ModTypeArrow (Maybe vn) (ModTypeExpBase f vn) (ModTypeExpBase f vn) SrcLoc |
Instances
| Show (ModTypeExpBase Info VName) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeExpBase Info VName -> ShowS show :: ModTypeExpBase Info VName -> String showList :: [ModTypeExpBase Info VName] -> ShowS | |
| Show (ModTypeExpBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeExpBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModTypeExpBase (NoInfo :: Type -> Type) Name -> String showList :: [ModTypeExpBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| (IsName vn, Annot f) => Pretty (ModTypeExpBase f vn) Source # | |
Defined in Language.Futhark.Pretty Methods pretty :: ModTypeExpBase f vn -> Doc ann Source # prettyList :: [ModTypeExpBase f vn] -> Doc ann Source # | |
| Located (ModTypeExpBase f vn) Source # | |
Defined in Language.Futhark.Syntax Methods locOf :: ModTypeExpBase f vn -> Loc Source # locOfList :: [ModTypeExpBase f vn] -> Loc Source # | |
data TypeRefBase (f :: Type -> Type) vn Source #
A type refinement.
Instances
| Show (TypeRefBase Info VName) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeRefBase Info VName -> ShowS show :: TypeRefBase Info VName -> String showList :: [TypeRefBase Info VName] -> ShowS | |
| Show (TypeRefBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeRefBase (NoInfo :: Type -> Type) Name -> ShowS show :: TypeRefBase (NoInfo :: Type -> Type) Name -> String showList :: [TypeRefBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Located (TypeRefBase f vn) Source # | |
Defined in Language.Futhark.Syntax | |
data ModTypeBindBase (f :: Type -> Type) vn Source #
Module type binding.
Constructors
| ModTypeBind | |
Fields
| |
Instances
| Show (ModTypeBindBase Info VName) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeBindBase Info VName -> ShowS show :: ModTypeBindBase Info VName -> String showList :: [ModTypeBindBase Info VName] -> ShowS | |
| Show (ModTypeBindBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeBindBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModTypeBindBase (NoInfo :: Type -> Type) Name -> String showList :: [ModTypeBindBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| (IsName vn, Annot f) => Pretty (ModTypeBindBase f vn) Source # | |
Defined in Language.Futhark.Pretty Methods pretty :: ModTypeBindBase f vn -> Doc ann Source # prettyList :: [ModTypeBindBase f vn] -> Doc ann Source # | |
| Located (ModTypeBindBase f vn) Source # | |
Defined in Language.Futhark.Syntax Methods locOf :: ModTypeBindBase f vn -> Loc Source # locOfList :: [ModTypeBindBase f vn] -> Loc Source # | |
data ModExpBase (f :: Type -> Type) 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
| Show (ModExpBase Info VName) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModExpBase Info VName -> ShowS show :: ModExpBase Info VName -> String showList :: [ModExpBase Info VName] -> ShowS | |
| Show (ModExpBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModExpBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModExpBase (NoInfo :: Type -> Type) Name -> String showList :: [ModExpBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| (IsName vn, Annot f) => Pretty (ModExpBase f vn) Source # | |
Defined in Language.Futhark.Pretty Methods pretty :: ModExpBase f vn -> Doc ann Source # prettyList :: [ModExpBase f vn] -> Doc ann Source # | |
| Located (ModExpBase f vn) Source # | |
Defined in Language.Futhark.Syntax | |
data ModBindBase (f :: Type -> Type) vn Source #
A module binding.
Constructors
| ModBind | |
Fields
| |
Instances
| Show (ModBindBase Info VName) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModBindBase Info VName -> ShowS show :: ModBindBase Info VName -> String showList :: [ModBindBase Info VName] -> ShowS | |
| Show (ModBindBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModBindBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModBindBase (NoInfo :: Type -> Type) Name -> String showList :: [ModBindBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| (IsName vn, Annot f) => Pretty (ModBindBase f vn) Source # | |
Defined in Language.Futhark.Pretty Methods pretty :: ModBindBase f vn -> Doc ann Source # prettyList :: [ModBindBase f vn] -> Doc ann Source # | |
| Located (ModBindBase f vn) Source # | |
Defined in Language.Futhark.Syntax | |
data ModParamBase (f :: Type -> Type) vn Source #
A module parameter.
Constructors
| ModParam | |
Fields
| |
Instances
| Show (ModParamBase Info VName) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModParamBase Info VName -> ShowS show :: ModParamBase Info VName -> String showList :: [ModParamBase Info VName] -> ShowS | |
| Show (ModParamBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModParamBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModParamBase (NoInfo :: Type -> Type) Name -> String showList :: [ModParamBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| (IsName vn, Annot f) => Pretty (ModParamBase f vn) Source # | |
Defined in Language.Futhark.Pretty Methods pretty :: ModParamBase f vn -> Doc ann Source # prettyList :: [ModParamBase f vn] -> Doc ann Source # | |
| Located (ModParamBase f vn) Source # | |
Defined in Language.Futhark.Syntax | |
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
| Show DocComment Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DocComment -> ShowS show :: DocComment -> String showList :: [DocComment] -> ShowS | |
| Located DocComment Source # | |
Defined in Language.Futhark.Syntax | |
data ValBindBase (f :: Type -> Type) vn Source #
Function Declarations
Constructors
| ValBind | |
Fields
| |
Instances
| Show (ValBindBase Info VName) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ValBindBase Info VName -> ShowS show :: ValBindBase Info VName -> String showList :: [ValBindBase Info VName] -> ShowS | |
| Show (ValBindBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ValBindBase (NoInfo :: Type -> Type) Name -> ShowS show :: ValBindBase (NoInfo :: Type -> Type) Name -> String showList :: [ValBindBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| (IsName vn, Annot f) => Pretty (ValBindBase f vn) Source # | |
Defined in Language.Futhark.Pretty Methods pretty :: ValBindBase f vn -> Doc ann Source # prettyList :: [ValBindBase f vn] -> Doc ann Source # | |
| Located (ValBindBase f vn) Source # | |
Defined in Language.Futhark.Syntax | |
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 | |
Fields
| |
Instances
| Show EntryPoint Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> EntryPoint -> ShowS show :: EntryPoint -> String showList :: [EntryPoint] -> ShowS | |
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.
Constructors
| EntryType | |
Fields
| |
data EntryParam Source #
A parameter of an entry point.
Constructors
| EntryParam | |
Fields | |
Instances
| Show EntryParam Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> EntryParam -> ShowS show :: EntryParam -> String showList :: [EntryParam] -> ShowS | |
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. |
Instances
| Show Liftedness Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> Liftedness -> ShowS show :: Liftedness -> String showList :: [Liftedness] -> ShowS | |
| Eq Liftedness Source # | |
Defined in Language.Futhark.Syntax | |
| Ord Liftedness Source # | |
Defined in Language.Futhark.Syntax Methods compare :: Liftedness -> Liftedness -> Ordering (<) :: Liftedness -> Liftedness -> Bool (<=) :: Liftedness -> Liftedness -> Bool (>) :: Liftedness -> Liftedness -> Bool (>=) :: Liftedness -> Liftedness -> Bool max :: Liftedness -> Liftedness -> Liftedness min :: Liftedness -> Liftedness -> Liftedness | |
| Pretty Liftedness Source # | |
Defined in Language.Futhark.Pretty | |
data TypeBindBase (f :: Type -> Type) vn Source #
Type Declarations
Constructors
| TypeBind | |
Fields
| |
Instances
| Show (TypeBindBase Info VName) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeBindBase Info VName -> ShowS show :: TypeBindBase Info VName -> String showList :: [TypeBindBase Info VName] -> ShowS | |
| Show (TypeBindBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeBindBase (NoInfo :: Type -> Type) Name -> ShowS show :: TypeBindBase (NoInfo :: Type -> Type) Name -> String showList :: [TypeBindBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| (IsName vn, Annot f) => Pretty (TypeBindBase f vn) Source # | |
Defined in Language.Futhark.Pretty Methods pretty :: TypeBindBase f vn -> Doc ann Source # prettyList :: [TypeBindBase f vn] -> Doc ann Source # | |
| Located (TypeBindBase f vn) Source # | |
Defined in Language.Futhark.Syntax | |
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
typeParamName :: TypeParamBase vn -> vn Source #
The name of a type parameter.
data ProgBase (f :: Type -> Type) vn Source #
The program described by a single Futhark file. May depend on other files.
Constructors
| Prog | |
Fields
| |
data DecBase (f :: Type -> Type) vn Source #
A top-level binding.
Constructors
| ValDec (ValBindBase f vn) | |
| TypeDec (TypeBindBase f vn) | |
| ModTypeDec (ModTypeBindBase f vn) | |
| ModDec (ModBindBase f vn) | |
| OpenDec (ModExpBase f vn) SrcLoc | |
| LocalDec (DecBase f vn) SrcLoc | |
| ImportDec FilePath (f ImportName) SrcLoc |
Miscellaneous
A value of type L a is a value of type a with an associated Loc, but
this location is ignored when performing comparisons.
Instances
| Functor L | |
| Data a => Data (L a) | |
Defined in Data.Loc Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> L a -> c (L a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (L a) dataTypeOf :: L a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (L a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (L a)) gmapT :: (forall b. Data b => b -> b) -> L a -> L a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> L a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> L a -> r gmapQ :: (forall d. Data d => d -> u) -> L a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> L a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> L a -> m (L a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> L a -> m (L a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> L a -> m (L a) | |
| Show x => Show (L x) | |
| Eq x => Eq (L x) | |
| Ord x => Ord (L x) | |
| Pretty x => Pretty (L x) | |
| Located (L a) | |
| Relocatable (L a) | |
No information functor. Usually used for placeholder type- or aliasing information.
Constructors
| NoInfo |
Instances
| Annot (NoInfo :: Type -> Type) Source # | |
Defined in Language.Futhark.Pretty | |
| Functor (NoInfo :: Type -> Type) Source # | |
| Foldable (NoInfo :: Type -> Type) Source # | |
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 elem :: Eq a => a -> NoInfo a -> Bool maximum :: Ord a => NoInfo a -> a | |
| Traversable (NoInfo :: Type -> Type) Source # | |
| Show vn => Show (AppExpBase (NoInfo :: Type -> Type) vn) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> AppExpBase (NoInfo :: Type -> Type) vn -> ShowS show :: AppExpBase (NoInfo :: Type -> Type) vn -> String showList :: [AppExpBase (NoInfo :: Type -> Type) vn] -> ShowS | |
| Show vn => Show (CaseBase (NoInfo :: Type -> Type) vn) Source # | |
| Show (DecBase (NoInfo :: Type -> Type) Name) Source # | |
| Show vn => Show (DimIndexBase (NoInfo :: Type -> Type) vn) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DimIndexBase (NoInfo :: Type -> Type) vn -> ShowS show :: DimIndexBase (NoInfo :: Type -> Type) vn -> String showList :: [DimIndexBase (NoInfo :: Type -> Type) vn] -> ShowS | |
| Show vn => Show (ExpBase (NoInfo :: Type -> Type) vn) Source # | |
| Show vn => Show (FieldBase (NoInfo :: Type -> Type) vn) Source # | |
| Show vn => Show (LoopFormBase (NoInfo :: Type -> Type) vn) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopFormBase (NoInfo :: Type -> Type) vn -> ShowS show :: LoopFormBase (NoInfo :: Type -> Type) vn -> String showList :: [LoopFormBase (NoInfo :: Type -> Type) vn] -> ShowS | |
| Show vn => Show (LoopInitBase (NoInfo :: Type -> Type) vn) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopInitBase (NoInfo :: Type -> Type) vn -> ShowS show :: LoopInitBase (NoInfo :: Type -> Type) vn -> String showList :: [LoopInitBase (NoInfo :: Type -> Type) vn] -> ShowS | |
| Show (ModBindBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModBindBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModBindBase (NoInfo :: Type -> Type) Name -> String showList :: [ModBindBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Show (ModExpBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModExpBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModExpBase (NoInfo :: Type -> Type) Name -> String showList :: [ModExpBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Show (ModParamBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModParamBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModParamBase (NoInfo :: Type -> Type) Name -> String showList :: [ModParamBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Show (ModTypeBindBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeBindBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModTypeBindBase (NoInfo :: Type -> Type) Name -> String showList :: [ModTypeBindBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Show (ModTypeExpBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeExpBase (NoInfo :: Type -> Type) Name -> ShowS show :: ModTypeExpBase (NoInfo :: Type -> Type) Name -> String showList :: [ModTypeExpBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Show (NoInfo a) Source # | |
| Show (ProgBase (NoInfo :: Type -> Type) Name) Source # | |
| Show (SpecBase (NoInfo :: Type -> Type) Name) Source # | |
| Show (TypeBindBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeBindBase (NoInfo :: Type -> Type) Name -> ShowS show :: TypeBindBase (NoInfo :: Type -> Type) Name -> String showList :: [TypeBindBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Show (TypeRefBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeRefBase (NoInfo :: Type -> Type) Name -> ShowS show :: TypeRefBase (NoInfo :: Type -> Type) Name -> String showList :: [TypeRefBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Show (ValBindBase (NoInfo :: Type -> Type) Name) Source # | |
Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ValBindBase (NoInfo :: Type -> Type) Name -> ShowS show :: ValBindBase (NoInfo :: Type -> Type) Name -> String showList :: [ValBindBase (NoInfo :: Type -> Type) Name] -> ShowS | |
| Eq (AppExpBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods (==) :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> Bool (/=) :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> Bool | |
| Eq (CaseBase (NoInfo :: Type -> Type) VName) Source # | |
| Eq (DimIndexBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods (==) :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> Bool (/=) :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> Bool | |
| Eq (ExpBase (NoInfo :: Type -> Type) VName) Source # | |
| Eq (FieldBase (NoInfo :: Type -> Type) VName) Source # | |
| Eq (LoopFormBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods (==) :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> Bool (/=) :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> Bool | |
| Eq (LoopInitBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods (==) :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> Bool (/=) :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> Bool | |
| Eq (NoInfo a) Source # | |
| Ord (AppExpBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> Ordering (<) :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> Bool (<=) :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> Bool (>) :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> Bool (>=) :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> Bool max :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName min :: AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName -> AppExpBase (NoInfo :: Type -> Type) VName | |
| Ord (CaseBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName -> Ordering (<) :: CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName -> Bool (<=) :: CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName -> Bool (>) :: CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName -> Bool (>=) :: CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName -> Bool max :: CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName min :: CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName -> CaseBase (NoInfo :: Type -> Type) VName | |
| Ord (DimIndexBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> Ordering (<) :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> Bool (<=) :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> Bool (>) :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> Bool (>=) :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> Bool max :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName min :: DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName -> DimIndexBase (NoInfo :: Type -> Type) VName | |
| Ord (ExpBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName -> Ordering (<) :: ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName -> Bool (<=) :: ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName -> Bool (>) :: ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName -> Bool (>=) :: ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName -> Bool max :: ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName min :: ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName -> ExpBase (NoInfo :: Type -> Type) VName | |
| Ord (FieldBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName -> Ordering (<) :: FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName -> Bool (<=) :: FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName -> Bool (>) :: FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName -> Bool (>=) :: FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName -> Bool max :: FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName min :: FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName -> FieldBase (NoInfo :: Type -> Type) VName | |
| Ord (LoopFormBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> Ordering (<) :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> Bool (<=) :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> Bool (>) :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> Bool (>=) :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> Bool max :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName min :: LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName -> LoopFormBase (NoInfo :: Type -> Type) VName | |
| Ord (LoopInitBase (NoInfo :: Type -> Type) VName) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> Ordering (<) :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> Bool (<=) :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> Bool (>) :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> Bool (>=) :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> Bool max :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName min :: LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName -> LoopInitBase (NoInfo :: Type -> Type) VName | |
| Ord (NoInfo a) Source # | |
Defined in Language.Futhark.Syntax | |
| (Show (NoInfo t), Show vn) => Show (PatBase (NoInfo :: Type -> Type) vn t) Source # | |
| Eq (NoInfo t) => Eq (PatBase (NoInfo :: Type -> Type) VName t) Source # | |
| Ord (NoInfo t) => Ord (PatBase (NoInfo :: Type -> Type) VName t) Source # | |
Defined in Language.Futhark.Syntax Methods compare :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Ordering (<) :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Bool (<=) :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Bool (>) :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Bool (>=) :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> Bool max :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t min :: PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t -> PatBase (NoInfo :: Type -> Type) VName t | |
| (Show (Info t), Show vn) => Show (IdentBase (NoInfo :: Type -> Type) vn t) Source # | |
Some information. The dual to NoInfo
Instances
A name qualified with a breadcrumb of module accesses.
Instances
| Functor QualName Source # | |
| Foldable QualName Source # | |
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 elem :: Eq a => a -> QualName a -> Bool maximum :: Ord a => QualName a -> a minimum :: Ord a => QualName a -> a | |
| Traversable QualName Source # | |
| Show vn => Show (QualName vn) Source # | |
| Eq v => Eq (QualName v) Source # | |
| Ord v => Ord (QualName v) Source # | |
| IsName vn => Pretty (QualName vn) Source # | |
mkApply :: ExpBase Info vn -> [(Maybe VName, ExpBase Info vn)] -> AppRes -> ExpBase Info vn Source #
Construct an Apply node, with type information.
mkApplyUT :: ExpBase (NoInfo :: Type -> Type) vn -> ExpBase (NoInfo :: Type -> Type) vn -> ExpBase (NoInfo :: Type -> Type) vn Source #
Construct an Apply node, without type information.
loopInitExp :: LoopInitBase Info VName -> ExpBase Info VName Source #
Retrieve the expression for the initial values of loop parameters.