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

Safe Haskell | Safe-Inferred
Language | GHC2021

Language.Futhark.Syntax

Contents

- Types
- Values
- Abstract syntax tree
- Module language
- Definitions
- Miscellaneous

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
  - = Nonunique
  - | Unique
- data IntType
  - = Int8
  - | Int16
  - | Int32
  - | Int64
- data FloatType
  - = Float16
  - | Float32
  - | Float64
- data PrimType
  - = Signed IntType
  - | Unsigned IntType
  - | FloatType FloatType
  - | Bool
- 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
  - = Named VName
  - | Unnamed
- data ScalarTypeBase dim u
  - = 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)
- data RetTypeBase dim as = RetType {
  - retDims :: [VName]
  - retType :: TypeBase dim as
  }
- 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
  - = Observe
  - | Consume
- 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
  - primValue :: v -> PrimValue
- data AttrInfo vn
  - = AttrAtom (AttrAtom vn) SrcLoc
  - | AttrComp Name [AttrInfo vn] SrcLoc
- data AttrAtom vn
  - = AtomName Name
  - | AtomInt Integer
- data BinOp
  - = Backtick
  - | Bang
  - | Equ
  - | 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 vn t = Ident {
  - identName :: vn
  - identType :: f t
  - identSrcLoc :: SrcLoc
  }
- data Inclusiveness a
  - = DownToExclusive a
  - | ToInclusive a
  - | UpToExclusive a
- data DimIndexBase f vn
  - = DimFix (ExpBase f vn)
  - | DimSlice (Maybe (ExpBase f vn)) (Maybe (ExpBase f vn)) (Maybe (ExpBase f vn))
- type SliceBase f vn = [DimIndexBase f vn]
- data SizeBinder vn = SizeBinder {
  - sizeName :: !vn
  - sizeLoc :: !SrcLoc
  }
- data AppExpBase f 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 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 vn
  - = RecordFieldExplicit (L Name) (ExpBase f vn) SrcLoc
  - | RecordFieldImplicit (L vn) (f StructType) SrcLoc
- data CaseBase f vn = CasePat (PatBase f vn StructType) (ExpBase f vn) SrcLoc
- data LoopInitBase f vn
  - = LoopInitExplicit (ExpBase f vn)
  - | LoopInitImplicit (f (ExpBase f vn))
- data LoopFormBase f 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 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 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
- data ModTypeExpBase f 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 vn = TypeRef (QualName vn) [TypeParamBase vn] (TypeExp (ExpBase f vn) vn) SrcLoc
- data ModTypeBindBase f vn = ModTypeBind {
  - modTypeName :: vn
  - modTypeExp :: ModTypeExpBase f vn
  - modTypeDoc :: Maybe DocComment
  - modTypeLoc :: SrcLoc
  }
- data ModExpBase f 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 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 vn = ModParam {
  - modParamName :: vn
  - modParamType :: ModTypeExpBase f vn
  - modParamAbs :: f [VName]
  - modParamLocation :: SrcLoc
  }
- data DocComment = DocComment Text SrcLoc
- data ValBindBase f 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 {
  - entryParams :: [EntryParam]
  - entryReturn :: EntryType
  }
- data EntryType = EntryType {
  - entryType :: StructType
  - entryAscribed :: Maybe (TypeExp (ExpBase Info VName) VName)
  }
- data EntryParam = EntryParam {
  - entryParamName :: Name
  - entryParamType :: EntryType
  }
- data Liftedness
  - = Unlifted
  - | SizeLifted
  - | Lifted
- data TypeBindBase f 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 vn = Prog {
  - progDoc :: Maybe DocComment
  - progDecs :: [DecBase f vn]
  }
- data DecBase f 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 = NoInfo
- newtype Info a = Info {
  - unInfo :: a
  }
- data QualName vn = QualName {
  - qualQuals :: ![vn]
  - qualLeaf :: !vn
  }
- mkApply :: ExpBase Info vn -> [(Maybe VName, ExpBase Info vn)] -> AppRes -> ExpBase Info vn
- mkApplyUT :: ExpBase NoInfo vn -> ExpBase NoInfo vn -> ExpBase NoInfo 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

Instances details

Monoid Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods mempty :: Uniqueness Source # mappend :: Uniqueness -> Uniqueness -> Uniqueness Source # mconcat :: [Uniqueness] -> Uniqueness Source #
Semigroup Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods (<>) :: Uniqueness -> Uniqueness -> Uniqueness Source # sconcat :: NonEmpty Uniqueness -> Uniqueness Source # stimes :: Integral b => b -> Uniqueness -> Uniqueness Source #
Show Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods showsPrec :: Int -> Uniqueness -> ShowS Source # show :: Uniqueness -> String Source # showList :: [Uniqueness] -> ShowS Source #
DeclExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declExtTypeOf :: DeclExtType -> DeclExtType Source #
DeclTyped DeclType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods declTypeOf :: DeclType -> DeclType Source #
ExtTyped DeclExtType Source # |
Instance details Defined in Futhark.IR.Prop.Types Methods extTypeOf :: DeclExtType -> ExtType Source #
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 Methods primRetType :: PrimType -> FunReturns Source # applyRetType :: Typed dec => [FunReturns] -> [Param dec] -> [(SubExp, Type)] -> Maybe [FunReturns] Source #
IsRetType DeclExtType Source # |
Instance details Defined in Futhark.IR.RetType Methods primRetType :: PrimType -> DeclExtType Source # applyRetType :: Typed dec => [DeclExtType] -> [Param dec] -> [(SubExp, Type)] -> Maybe [DeclExtType] Source #
ASTMappable ResRetType Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> ResRetType -> m ResRetType Source #
Eq Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods (==) :: Uniqueness -> Uniqueness -> Bool Source # (/=) :: Uniqueness -> Uniqueness -> Bool Source #
Ord Uniqueness Source # |

Instance details

Defined in Language.Futhark.Core

Methods

compare :: Uniqueness -> Uniqueness -> Ordering Source #

(<) :: Uniqueness -> Uniqueness -> Bool Source #

(<=) :: Uniqueness -> Uniqueness -> Bool Source #

(>) :: Uniqueness -> Uniqueness -> Bool Source #

(>=) :: Uniqueness -> Uniqueness -> Bool Source #

max :: Uniqueness -> Uniqueness -> Uniqueness Source #

min :: Uniqueness -> Uniqueness -> Uniqueness Source #

Pretty Uniqueness Source # |
Instance details Defined in Language.Futhark.Core Methods pretty :: Uniqueness -> Doc ann Source # prettyList :: [Uniqueness] -> Doc ann Source #
Simplifiable [FunReturns] Source # |
Instance details Defined in Futhark.IR.Mem Methods simplify :: SimplifiableRep rep => [FunReturns] -> SimpleM rep [FunReturns] Source #
ASTMappable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeBase Size Uniqueness -> m (TypeBase Size Uniqueness) Source #
Substitutable (RetTypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size Uniqueness -> RetTypeBase Size Uniqueness Source #
Substitutable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> TypeBase Size Uniqueness -> TypeBase Size Uniqueness Source #
FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods declExtTypeOf :: MemInfo ExtSize Uniqueness ret -> DeclExtType Source #
DeclTyped (MemInfo SubExp Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods declTypeOf :: MemInfo SubExp Uniqueness ret -> DeclType Source #
FixExt ret => ExtTyped (MemInfo ExtSize Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods extTypeOf :: MemInfo ExtSize Uniqueness ret -> ExtType Source #
Typed (MemInfo SubExp Uniqueness ret) Source # |
Instance details Defined in Futhark.IR.Mem Methods typeOf :: MemInfo SubExp Uniqueness ret -> Type Source #

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 Methods minBound :: IntType Source # maxBound :: IntType Source #
Enum IntType Source # |

Instance details

Defined in Language.Futhark.Primitive

Methods

succ :: IntType -> IntType Source #

pred :: IntType -> IntType Source #

toEnum :: Int -> IntType Source #

fromEnum :: IntType -> Int Source #

enumFrom :: IntType -> [IntType] Source #

enumFromThen :: IntType -> IntType -> [IntType] Source #

enumFromTo :: IntType -> IntType -> [IntType] Source #

enumFromThenTo :: IntType -> IntType -> IntType -> [IntType] Source #

Show IntType Source # |
Instance details Defined in Language.Futhark.Primitive Methods showsPrec :: Int -> IntType -> ShowS Source # show :: IntType -> String Source # showList :: [IntType] -> ShowS Source #
Eq IntType Source # |
Instance details Defined in Language.Futhark.Primitive Methods (==) :: IntType -> IntType -> Bool Source # (/=) :: IntType -> IntType -> Bool Source #
Ord IntType Source # |
Instance details Defined in Language.Futhark.Primitive Methods compare :: IntType -> IntType -> Ordering Source # (<) :: IntType -> IntType -> Bool Source # (<=) :: IntType -> IntType -> Bool Source # (>) :: IntType -> IntType -> Bool Source # (>=) :: IntType -> IntType -> Bool Source # max :: IntType -> IntType -> IntType Source # min :: IntType -> IntType -> IntType Source #
Pretty IntType Source # |
Instance details Defined in Language.Futhark.Primitive Methods pretty :: IntType -> Doc ann Source # prettyList :: [IntType] -> Doc ann Source #

data FloatType Source #

A floating point type.

Constructors

Float16 |
Float32 |
Float64 |

#### Instances

Instances details

Bounded FloatType Source # |
Instance details Defined in Language.Futhark.Primitive Methods minBound :: FloatType Source # maxBound :: FloatType Source #
Enum FloatType Source # |

Instance details

Defined in Language.Futhark.Primitive

Methods

succ :: FloatType -> FloatType Source #

pred :: FloatType -> FloatType Source #

toEnum :: Int -> FloatType Source #

fromEnum :: FloatType -> Int Source #

enumFrom :: FloatType -> [FloatType] Source #

enumFromThen :: FloatType -> FloatType -> [FloatType] Source #

enumFromTo :: FloatType -> FloatType -> [FloatType] Source #

enumFromThenTo :: FloatType -> FloatType -> FloatType -> [FloatType] Source #

Show FloatType Source # |
Instance details Defined in Language.Futhark.Primitive Methods showsPrec :: Int -> FloatType -> ShowS Source # show :: FloatType -> String Source # showList :: [FloatType] -> ShowS Source #
Eq FloatType Source # |
Instance details Defined in Language.Futhark.Primitive Methods (==) :: FloatType -> FloatType -> Bool Source # (/=) :: FloatType -> FloatType -> Bool Source #
Ord FloatType Source # |

Instance details

Defined in Language.Futhark.Primitive

Methods

compare :: FloatType -> FloatType -> Ordering Source #

(<) :: FloatType -> FloatType -> Bool Source #

(<=) :: FloatType -> FloatType -> Bool Source #

(>) :: FloatType -> FloatType -> Bool Source #

(>=) :: FloatType -> FloatType -> Bool Source #

max :: FloatType -> FloatType -> FloatType Source #

min :: FloatType -> FloatType -> FloatType Source #

Pretty FloatType Source # |
Instance details Defined in Language.Futhark.Primitive Methods pretty :: FloatType -> Doc ann Source # prettyList :: [FloatType] -> Doc ann Source #

data PrimType Source #

Low-level primitive types.

Constructors

Signed IntType |
Unsigned IntType |
FloatType FloatType |
Bool |

#### Instances

Instances details

Show PrimType Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> PrimType -> ShowS Source # show :: PrimType -> String Source # showList :: [PrimType] -> ShowS Source #
Eq PrimType Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: PrimType -> PrimType -> Bool Source # (/=) :: PrimType -> PrimType -> Bool Source #
Ord PrimType Source # |
Instance details Defined in Language.Futhark.Syntax Methods compare :: PrimType -> PrimType -> Ordering Source # (<) :: PrimType -> PrimType -> Bool Source # (<=) :: PrimType -> PrimType -> Bool Source # (>) :: PrimType -> PrimType -> Bool Source # (>=) :: PrimType -> PrimType -> Bool Source # max :: PrimType -> PrimType -> PrimType Source # min :: PrimType -> PrimType -> PrimType Source #
Pretty PrimType Source # |
Instance details Defined in Language.Futhark.Syntax Methods pretty :: PrimType -> Doc ann Source # prettyList :: [PrimType] -> Doc ann Source #

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

- shapeDims :: [dim]

#### Instances

Instances details

Foldable Shape Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

toList :: Shape a -> [a] Source #

null :: Shape a -> Bool Source #

length :: Shape a -> Int Source #

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

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

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

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

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

Traversable Shape Source # |
Instance details Defined in Language.Futhark.Syntax Methods traverse :: Applicative f => (a -> f b) -> Shape a -> f (Shape b) Source # sequenceA :: Applicative f => Shape (f a) -> f (Shape a) Source # mapM :: Monad m => (a -> m b) -> Shape a -> m (Shape b) Source # sequence :: Monad m => Shape (m a) -> m (Shape a) Source #
Functor Shape Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> Shape a -> Shape b Source # (<$) :: a -> Shape b -> Shape a Source #
Monoid (Shape dim) Source # |
Instance details Defined in Language.Futhark.Syntax Methods mempty :: Shape dim Source # mappend :: Shape dim -> Shape dim -> Shape dim Source # mconcat :: [Shape dim] -> Shape dim Source #
Semigroup (Shape dim) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (<>) :: Shape dim -> Shape dim -> Shape dim Source # sconcat :: NonEmpty (Shape dim) -> Shape dim Source # stimes :: Integral b => b -> Shape dim -> Shape dim Source #
Show dim => Show (Shape dim) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> Shape dim -> ShowS Source # show :: Shape dim -> String Source # showList :: [Shape dim] -> ShowS Source #
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 Source # (/=) :: Shape dim -> Shape dim -> Bool Source #
Ord dim => Ord (Shape dim) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

Pretty (Shape Int64) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: Shape Int64 -> Doc ann Source # prettyList :: [Shape Int64] -> Doc ann Source #
Pretty (Shape Size) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: Shape Size -> Doc ann Source # prettyList :: [Shape Size] -> Doc ann Source #
Pretty (Shape ()) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: Shape () -> Doc ann Source # prettyList :: [Shape ()] -> Doc ann Source #
Pretty (Shape Bool) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: Shape Bool -> Doc ann Source # prettyList :: [Shape Bool] -> Doc ann Source #

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 Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> TypeBase a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> TypeBase a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> TypeBase a b -> c Source #
Bifunctor TypeBase Source # |
Instance details Defined in Language.Futhark.Syntax Methods bimap :: (a -> b) -> (c -> d) -> TypeBase a c -> TypeBase b d Source # first :: (a -> b) -> TypeBase a c -> TypeBase b c Source # second :: (b -> c) -> TypeBase a b -> TypeBase a c Source #
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) Source #
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 Methods astMap :: Monad m => ASTMapper m -> StructType -> m StructType Source #
Substitutable ParamType Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> ParamType -> ParamType Source #
Substitutable StructType Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> StructType -> StructType Source #
Foldable (TypeBase dim) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

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

null :: TypeBase dim a -> Bool Source #

length :: TypeBase dim a -> Int Source #

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

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

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

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

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

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) Source # sequenceA :: Applicative f => TypeBase dim (f a) -> f (TypeBase dim a) Source # mapM :: Monad m => (a -> m b) -> TypeBase dim a -> m (TypeBase dim b) Source # sequence :: Monad m => TypeBase dim (m a) -> m (TypeBase dim a) Source #
Functor (TypeBase dim) Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> TypeBase dim a -> TypeBase dim b Source # (<$) :: a -> TypeBase dim b -> TypeBase dim a Source #
Substitutable (Pat ParamType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat ParamType -> Pat ParamType Source #
Substitutable (Pat StructType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat StructType -> Pat StructType Source #
(Show dim, Show u) => Show (TypeBase dim u) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeBase dim u -> ShowS Source # show :: TypeBase dim u -> String Source # showList :: [TypeBase dim u] -> ShowS Source #
ASTMappable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeBase Size Uniqueness -> m (TypeBase Size Uniqueness) Source #
Substitutable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> TypeBase Size Uniqueness -> TypeBase Size Uniqueness Source #
(Eq dim, Eq u) => Eq (TypeBase dim u) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: TypeBase dim u -> TypeBase dim u -> Bool Source # (/=) :: TypeBase dim u -> TypeBase dim u -> Bool Source #
(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 Source #

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

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

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

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

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

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

(Pretty (Shape dim), Pretty u) => Pretty (TypeBase dim u) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: TypeBase dim u -> Doc ann Source # prettyList :: [TypeBase dim u] -> Doc ann Source #
ASTMappable (PatBase Info VName ParamType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName ParamType -> m (PatBase Info VName ParamType) Source #
ASTMappable (PatBase Info VName StructType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName StructType -> m (PatBase Info VName StructType) Source #
ASTMappable (IdentBase Info VName StructType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> IdentBase Info VName StructType -> m (IdentBase Info VName StructType) Source #

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

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

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

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

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

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

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

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

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

toList :: TypeArg a -> [a] Source #

null :: TypeArg a -> Bool Source #

length :: TypeArg a -> Int Source #

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

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

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

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

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

Traversable TypeArg Source # |
Instance details Defined in Language.Futhark.Syntax Methods traverse :: Applicative f => (a -> f b) -> TypeArg a -> f (TypeArg b) Source # sequenceA :: Applicative f => TypeArg (f a) -> f (TypeArg a) Source # mapM :: Monad m => (a -> m b) -> TypeArg a -> m (TypeArg b) Source # sequence :: Monad m => TypeArg (m a) -> m (TypeArg a) Source #
Functor TypeArg Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> TypeArg a -> TypeArg b Source # (<$) :: a -> TypeArg b -> TypeArg a Source #
Show dim => Show (TypeArg dim) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeArg dim -> ShowS Source # show :: TypeArg dim -> String Source # showList :: [TypeArg dim] -> ShowS Source #
Eq dim => Eq (TypeArg dim) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: TypeArg dim -> TypeArg dim -> Bool Source # (/=) :: TypeArg dim -> TypeArg dim -> Bool Source #
Ord dim => Ord (TypeArg dim) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

Pretty (TypeArg Size) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: TypeArg Size -> Doc ann Source # prettyList :: [TypeArg Size] -> Doc ann Source #

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

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

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

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

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

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

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

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

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

toList :: SizeExp a -> [a] Source #

null :: SizeExp a -> Bool Source #

length :: SizeExp a -> Int Source #

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

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

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

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

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

Traversable SizeExp Source # |
Instance details Defined in Language.Futhark.Syntax Methods traverse :: Applicative f => (a -> f b) -> SizeExp a -> f (SizeExp b) Source # sequenceA :: Applicative f => SizeExp (f a) -> f (SizeExp a) Source # mapM :: Monad m => (a -> m b) -> SizeExp a -> m (SizeExp b) Source # sequence :: Monad m => SizeExp (m a) -> m (SizeExp a) Source #
Functor SizeExp Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> SizeExp a -> SizeExp b Source # (<$) :: a -> SizeExp b -> SizeExp a Source #
Show d => Show (SizeExp d) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> SizeExp d -> ShowS Source # show :: SizeExp d -> String Source # showList :: [SizeExp d] -> ShowS Source #
ASTMappable (SizeExp (ExpBase Info VName)) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> SizeExp (ExpBase Info VName) -> m (SizeExp (ExpBase Info VName)) Source #
Eq d => Eq (SizeExp d) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: SizeExp d -> SizeExp d -> Bool Source # (/=) :: SizeExp d -> SizeExp d -> Bool Source #
Ord d => Ord (SizeExp d) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

Pretty d => Pretty (SizeExp d) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: SizeExp d -> Doc ann Source # prettyList :: [SizeExp d] -> Doc ann Source #
Located (SizeExp d) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: SizeExp d -> Loc Source # locOfList :: [SizeExp d] -> Loc Source #

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 `TypeBase`s 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

Instances details

Bifoldable TypeExp Source # |
Instance details Defined in Language.Futhark.Syntax Methods bifold :: Monoid m => TypeExp m m -> m Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> TypeExp a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> TypeExp a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> TypeExp a b -> c Source #
Bifunctor TypeExp Source # |
Instance details Defined in Language.Futhark.Syntax Methods bimap :: (a -> b) -> (c -> d) -> TypeExp a c -> TypeExp b d Source # first :: (a -> b) -> TypeExp a c -> TypeExp b c Source # second :: (b -> c) -> TypeExp a b -> TypeExp a c Source #
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) Source #
Foldable (TypeExp dim) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

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

null :: TypeExp dim a -> Bool Source #

length :: TypeExp dim a -> Int Source #

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

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

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

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

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

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) Source # sequenceA :: Applicative f => TypeExp dim (f a) -> f (TypeExp dim a) Source # mapM :: Monad m => (a -> m b) -> TypeExp dim a -> m (TypeExp dim b) Source # sequence :: Monad m => TypeExp dim (m a) -> m (TypeExp dim a) Source #
Functor (TypeExp d) Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> TypeExp d a -> TypeExp d b Source # (<$) :: a -> TypeExp d b -> TypeExp d a Source #
(Show vn, Show d) => Show (TypeExp d vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeExp d vn -> ShowS Source # show :: TypeExp d vn -> String Source # showList :: [TypeExp d vn] -> ShowS Source #
ASTMappable (TypeExp (ExpBase Info VName) VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeExp (ExpBase Info VName) VName -> m (TypeExp (ExpBase Info VName) VName) Source #
(Eq vn, Eq d) => Eq (TypeExp d vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: TypeExp d vn -> TypeExp d vn -> Bool Source # (/=) :: TypeExp d vn -> TypeExp d vn -> Bool Source #
(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 Source #

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

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

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

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

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

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

(IsName vn, Pretty d) => Pretty (TypeExp d vn) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: TypeExp d vn -> Doc ann Source # prettyList :: [TypeExp d vn] -> Doc ann Source #
Located (TypeExp f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: TypeExp f vn -> Loc Source # locOfList :: [TypeExp f vn] -> Loc Source #

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 Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> TypeArgExp a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> TypeArgExp a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> TypeArgExp a b -> c Source #
Bifunctor TypeArgExp Source # |
Instance details Defined in Language.Futhark.Syntax Methods bimap :: (a -> b) -> (c -> d) -> TypeArgExp a c -> TypeArgExp b d Source # first :: (a -> b) -> TypeArgExp a c -> TypeArgExp b c Source # second :: (b -> c) -> TypeArgExp a b -> TypeArgExp a c Source #
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) Source #
Foldable (TypeArgExp d) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

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

null :: TypeArgExp d a -> Bool Source #

length :: TypeArgExp d a -> Int Source #

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

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

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

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

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

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) Source # sequenceA :: Applicative f => TypeArgExp d (f a) -> f (TypeArgExp d a) Source # mapM :: Monad m => (a -> m b) -> TypeArgExp d a -> m (TypeArgExp d b) Source # sequence :: Monad m => TypeArgExp d (m a) -> m (TypeArgExp d a) Source #
Functor (TypeArgExp d) Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> TypeArgExp d a -> TypeArgExp d b Source # (<$) :: a -> TypeArgExp d b -> TypeArgExp d a Source #
(Show d, Show vn) => Show (TypeArgExp d vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeArgExp d vn -> ShowS Source # show :: TypeArgExp d vn -> String Source # showList :: [TypeArgExp d vn] -> ShowS Source #
ASTMappable (TypeArgExp (ExpBase Info VName) VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeArgExp (ExpBase Info VName) VName -> m (TypeArgExp (ExpBase Info VName) VName) Source #
(Eq d, Eq vn) => Eq (TypeArgExp d vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: TypeArgExp d vn -> TypeArgExp d vn -> Bool Source # (/=) :: TypeArgExp d vn -> TypeArgExp d vn -> Bool Source #
(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 Source #

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

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

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

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

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

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

(Pretty d, IsName vn) => Pretty (TypeArgExp d vn) Source # |
Instance details 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 # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: TypeArgExp f vn -> Loc Source # locOfList :: [TypeArgExp f vn] -> Loc Source #

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 Source # show :: PName -> String Source # showList :: [PName] -> ShowS Source #
Eq PName Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: PName -> PName -> Bool Source # (/=) :: PName -> PName -> Bool Source #
Ord PName Source # |
Instance details Defined in Language.Futhark.Syntax Methods compare :: PName -> PName -> Ordering Source # (<) :: PName -> PName -> Bool Source # (<=) :: PName -> PName -> Bool Source # (>) :: PName -> PName -> Bool Source # (>=) :: PName -> PName -> Bool Source # max :: PName -> PName -> PName Source # min :: PName -> PName -> PName Source #

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 Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> ScalarTypeBase a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> ScalarTypeBase a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> ScalarTypeBase a b -> c Source #
Bifunctor ScalarTypeBase Source # |
Instance details Defined in Language.Futhark.Syntax Methods bimap :: (a -> b) -> (c -> d) -> ScalarTypeBase a c -> ScalarTypeBase b d Source # first :: (a -> b) -> ScalarTypeBase a c -> ScalarTypeBase b c Source # second :: (b -> c) -> ScalarTypeBase a b -> ScalarTypeBase a c Source #
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) Source #
Foldable (ScalarTypeBase dim) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

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

null :: ScalarTypeBase dim a -> Bool Source #

length :: ScalarTypeBase dim a -> Int Source #

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

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

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

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

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

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

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

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

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

Functor (ScalarTypeBase dim) Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> ScalarTypeBase dim a -> ScalarTypeBase dim b Source # (<$) :: a -> ScalarTypeBase dim b -> ScalarTypeBase dim a Source #
(Show dim, Show u) => Show (ScalarTypeBase dim u) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ScalarTypeBase dim u -> ShowS Source # show :: ScalarTypeBase dim u -> String Source # showList :: [ScalarTypeBase dim u] -> ShowS Source #
(Eq dim, Eq u) => Eq (ScalarTypeBase dim u) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: ScalarTypeBase dim u -> ScalarTypeBase dim u -> Bool Source # (/=) :: ScalarTypeBase dim u -> ScalarTypeBase dim u -> Bool Source #
(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 Source #

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

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

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

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

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

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

(Pretty (Shape dim), Pretty u) => Pretty (ScalarTypeBase dim u) Source # |
Instance details 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.

Constructors

RetType |

Fields

- retDims :: [VName]
- retType :: TypeBase dim as

#### Instances

Instances details

Bifoldable RetTypeBase Source # |
Instance details Defined in Language.Futhark.Syntax Methods bifold :: Monoid m => RetTypeBase m m -> m Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> RetTypeBase a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> RetTypeBase a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> RetTypeBase a b -> c Source #
Bifunctor RetTypeBase Source # |
Instance details Defined in Language.Futhark.Syntax Methods bimap :: (a -> b) -> (c -> d) -> RetTypeBase a c -> RetTypeBase b d Source # first :: (a -> b) -> RetTypeBase a c -> RetTypeBase b c Source # second :: (b -> c) -> RetTypeBase a b -> RetTypeBase a c Source #
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) Source #
ASTMappable ResRetType Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> ResRetType -> m ResRetType Source #
Foldable (RetTypeBase dim) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

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

null :: RetTypeBase dim a -> Bool Source #

length :: RetTypeBase dim a -> Int Source #

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

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

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

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

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

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

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

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

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

Functor (RetTypeBase dim) Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> RetTypeBase dim a -> RetTypeBase dim b Source # (<$) :: a -> RetTypeBase dim b -> RetTypeBase dim a Source #
(Show as, Show dim) => Show (RetTypeBase dim as) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> RetTypeBase dim as -> ShowS Source # show :: RetTypeBase dim as -> String Source # showList :: [RetTypeBase dim as] -> ShowS Source #
Substitutable (RetTypeBase Size NoUniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size NoUniqueness -> RetTypeBase Size NoUniqueness Source #
Substitutable (RetTypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size Uniqueness -> RetTypeBase Size Uniqueness Source #
(Eq as, Eq dim) => Eq (RetTypeBase dim as) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: RetTypeBase dim as -> RetTypeBase dim as -> Bool Source # (/=) :: RetTypeBase dim as -> RetTypeBase dim as -> Bool Source #
(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 Source #

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

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

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

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

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

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

(Pretty (Shape dim), Pretty u) => Pretty (RetTypeBase dim u) Source # |
Instance details 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.

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 Source # mappend :: Diet -> Diet -> Diet Source # mconcat :: [Diet] -> Diet Source #
Semigroup Diet Source # |
Instance details Defined in Language.Futhark.Syntax Methods (<>) :: Diet -> Diet -> Diet Source # sconcat :: NonEmpty Diet -> Diet Source # stimes :: Integral b => b -> Diet -> Diet Source #
Show Diet Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> Diet -> ShowS Source # show :: Diet -> String Source # showList :: [Diet] -> ShowS Source #
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 Methods applySubst :: TypeSubs -> ParamType -> ParamType Source #
Eq Diet Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: Diet -> Diet -> Bool Source # (/=) :: Diet -> Diet -> Bool Source #
Ord Diet Source # |
Instance details Defined in Language.Futhark.Syntax Methods compare :: Diet -> Diet -> Ordering Source # (<) :: Diet -> Diet -> Bool Source # (<=) :: Diet -> Diet -> Bool Source # (>) :: Diet -> Diet -> Bool Source # (>=) :: Diet -> Diet -> Bool Source # max :: Diet -> Diet -> Diet Source # min :: Diet -> Diet -> Diet Source #
Pretty Diet Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: Diet -> Doc ann Source # prettyList :: [Diet] -> Doc ann Source #
Substitutable (Pat ParamType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat ParamType -> Pat ParamType Source #
ASTMappable (PatBase Info VName ParamType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName ParamType -> m (PatBase Info VName ParamType) Source #

# Values

data IntValue Source #

An integer value.

Constructors

Int8Value !Int8 |
Int16Value !Int16 |
Int32Value !Int32 |
Int64Value !Int64 |

#### Instances

Instances details

Show IntValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods showsPrec :: Int -> IntValue -> ShowS Source # show :: IntValue -> String Source # showList :: [IntValue] -> ShowS Source #
IsValue IntValue Source # |
Instance details Defined in Futhark.IR.Prop.Constants Methods value :: IntValue -> PrimValue Source #
Eq IntValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods (==) :: IntValue -> IntValue -> Bool Source # (/=) :: IntValue -> IntValue -> Bool Source #
Ord IntValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods compare :: IntValue -> IntValue -> Ordering Source # (<) :: IntValue -> IntValue -> Bool Source # (<=) :: IntValue -> IntValue -> Bool Source # (>) :: IntValue -> IntValue -> Bool Source # (>=) :: IntValue -> IntValue -> Bool Source # max :: IntValue -> IntValue -> IntValue Source # min :: IntValue -> IntValue -> IntValue Source #
ToExp IntValue Source # |
Instance details Defined in Futhark.CodeGen.Backends.SimpleRep Methods toExp :: IntValue -> SrcLoc -> Exp Source #
Pretty IntValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods pretty :: IntValue -> Doc ann Source # prettyList :: [IntValue] -> Doc ann Source #

data FloatValue Source #

A floating-point value.

Constructors

Float16Value !Half |
Float32Value !Float |
Float64Value !Double |

#### Instances

Instances details

Show FloatValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods showsPrec :: Int -> FloatValue -> ShowS Source # show :: FloatValue -> String Source # showList :: [FloatValue] -> ShowS Source #
IsValue FloatValue Source # |
Instance details Defined in Futhark.IR.Prop.Constants Methods value :: FloatValue -> PrimValue Source #
Eq FloatValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods (==) :: FloatValue -> FloatValue -> Bool Source # (/=) :: FloatValue -> FloatValue -> Bool Source #
Ord FloatValue Source # |

Instance details

Defined in Language.Futhark.Primitive

Methods

compare :: FloatValue -> FloatValue -> Ordering Source #

(<) :: FloatValue -> FloatValue -> Bool Source #

(<=) :: FloatValue -> FloatValue -> Bool Source #

(>) :: FloatValue -> FloatValue -> Bool Source #

(>=) :: FloatValue -> FloatValue -> Bool Source #

max :: FloatValue -> FloatValue -> FloatValue Source #

min :: FloatValue -> FloatValue -> FloatValue Source #

ToExp FloatValue Source # |
Instance details Defined in Futhark.CodeGen.Backends.SimpleRep Methods toExp :: FloatValue -> SrcLoc -> Exp Source #
Pretty FloatValue Source # |
Instance details Defined in Language.Futhark.Primitive Methods pretty :: FloatValue -> Doc ann Source # prettyList :: [FloatValue] -> Doc ann Source #

data PrimValue Source #

Non-array values.

Constructors

SignedValue !IntValue |
UnsignedValue !IntValue |
FloatValue !FloatValue |
BoolValue !Bool |

#### Instances

Instances details

Show PrimValue Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> PrimValue -> ShowS Source # show :: PrimValue -> String Source # showList :: [PrimValue] -> ShowS Source #
Eq PrimValue Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: PrimValue -> PrimValue -> Bool Source # (/=) :: PrimValue -> PrimValue -> Bool Source #
Ord PrimValue Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: PrimValue -> PrimValue -> Ordering Source #

(<) :: PrimValue -> PrimValue -> Bool Source #

(<=) :: PrimValue -> PrimValue -> Bool Source #

(>) :: PrimValue -> PrimValue -> Bool Source #

(>=) :: PrimValue -> PrimValue -> Bool Source #

max :: PrimValue -> PrimValue -> PrimValue Source #

min :: PrimValue -> PrimValue -> PrimValue Source #

Pretty PrimValue Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: PrimValue -> Doc ann Source # prettyList :: [PrimValue] -> Doc ann Source #

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 Methods primValue :: Int16 -> PrimValue Source #
IsPrimValue Int32 Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Int32 -> PrimValue Source #
IsPrimValue Int64 Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Int64 -> PrimValue Source #
IsPrimValue Int8 Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Int8 -> PrimValue Source #
IsPrimValue Word16 Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Word16 -> PrimValue Source #
IsPrimValue Word32 Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Word32 -> PrimValue Source #
IsPrimValue Word64 Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Word64 -> PrimValue Source #
IsPrimValue Word8 Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Word8 -> PrimValue Source #
IsPrimValue Bool Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Bool -> PrimValue Source #
IsPrimValue Double Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Double -> PrimValue Source #
IsPrimValue Float Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Float -> PrimValue Source #
IsPrimValue Int Source # |
Instance details Defined in Language.Futhark.Syntax Methods primValue :: Int -> PrimValue Source #

# Abstract syntax tree

data AttrInfo vn Source #

The payload of an attribute.

Constructors

AttrAtom (AttrAtom vn) SrcLoc |
AttrComp Name [AttrInfo vn] SrcLoc |

#### Instances

Instances details

Show (AttrInfo vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> AttrInfo vn -> ShowS Source # show :: AttrInfo vn -> String Source # showList :: [AttrInfo vn] -> ShowS Source #
Eq (AttrInfo vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: AttrInfo vn -> AttrInfo vn -> Bool Source # (/=) :: AttrInfo vn -> AttrInfo vn -> Bool Source #
Ord (AttrInfo vn) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

IsName vn => Pretty (AttrInfo vn) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: AttrInfo vn -> Doc ann Source # prettyList :: [AttrInfo vn] -> Doc ann Source #

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 Source # show :: AttrAtom vn -> String Source # showList :: [AttrAtom vn] -> ShowS Source #
Eq (AttrAtom vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: AttrAtom vn -> AttrAtom vn -> Bool Source # (/=) :: AttrAtom vn -> AttrAtom vn -> Bool Source #
Ord (AttrAtom vn) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

IsName vn => Pretty (AttrAtom vn) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: AttrAtom vn -> Doc ann Source # prettyList :: [AttrAtom vn] -> Doc ann Source #

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 Methods minBound :: BinOp Source # maxBound :: BinOp Source #
Enum BinOp Source # |
Instance details Defined in Language.Futhark.Syntax Methods succ :: BinOp -> BinOp Source # pred :: BinOp -> BinOp Source # toEnum :: Int -> BinOp Source # fromEnum :: BinOp -> Int Source # enumFrom :: BinOp -> [BinOp] Source # enumFromThen :: BinOp -> BinOp -> [BinOp] Source # enumFromTo :: BinOp -> BinOp -> [BinOp] Source # enumFromThenTo :: BinOp -> BinOp -> BinOp -> [BinOp] Source #
Show BinOp Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> BinOp -> ShowS Source # show :: BinOp -> String Source # showList :: [BinOp] -> ShowS Source #
Eq BinOp Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: BinOp -> BinOp -> Bool Source # (/=) :: BinOp -> BinOp -> Bool Source #
Ord BinOp Source # |
Instance details Defined in Language.Futhark.Syntax Methods compare :: BinOp -> BinOp -> Ordering Source # (<) :: BinOp -> BinOp -> Bool Source # (<=) :: BinOp -> BinOp -> Bool Source # (>) :: BinOp -> BinOp -> Bool Source # (>=) :: BinOp -> BinOp -> Bool Source # max :: BinOp -> BinOp -> BinOp Source # min :: BinOp -> BinOp -> BinOp Source #
Pretty BinOp Source # |
Instance details Defined in Language.Futhark.Syntax Methods pretty :: BinOp -> Doc ann Source # prettyList :: [BinOp] -> Doc ann Source #

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

- identName :: vn
- identType :: f t
- identSrcLoc :: SrcLoc

#### Instances

Instances details

Show (Info t) => Show (IdentBase Info VName t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> IdentBase Info VName t -> ShowS Source # show :: IdentBase Info VName t -> String Source # showList :: [IdentBase Info VName t] -> ShowS Source #
(Show (Info t), Show vn) => Show (IdentBase (NoInfo :: Type -> Type) vn t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> IdentBase NoInfo vn t -> ShowS Source # show :: IdentBase NoInfo vn t -> String Source # showList :: [IdentBase NoInfo vn t] -> ShowS Source #
ASTMappable (IdentBase Info VName StructType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> IdentBase Info VName StructType -> m (IdentBase Info VName StructType) Source #
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 Source # (/=) :: IdentBase ty vn t -> IdentBase ty vn t -> Bool Source #
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 Source #

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

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

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

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

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

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

IsName vn => Pretty (IdentBase f vn t) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: IdentBase f vn t -> Doc ann Source # prettyList :: [IdentBase f vn t] -> Doc ann Source #
Located (IdentBase ty vn t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: IdentBase ty vn t -> Loc Source # locOfList :: [IdentBase ty vn t] -> Loc 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

Instances details

Foldable Inclusiveness Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

toList :: Inclusiveness a -> [a] Source #

null :: Inclusiveness a -> Bool Source #

length :: Inclusiveness a -> Int Source #

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

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

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

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

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

Traversable Inclusiveness Source # |
Instance details Defined in Language.Futhark.Syntax Methods traverse :: Applicative f => (a -> f b) -> Inclusiveness a -> f (Inclusiveness b) Source # sequenceA :: Applicative f => Inclusiveness (f a) -> f (Inclusiveness a) Source # mapM :: Monad m => (a -> m b) -> Inclusiveness a -> m (Inclusiveness b) Source # sequence :: Monad m => Inclusiveness (m a) -> m (Inclusiveness a) Source #
Functor Inclusiveness Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> Inclusiveness a -> Inclusiveness b Source # (<$) :: a -> Inclusiveness b -> Inclusiveness a Source #
Show a => Show (Inclusiveness a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> Inclusiveness a -> ShowS Source # show :: Inclusiveness a -> String Source # showList :: [Inclusiveness a] -> ShowS Source #
Eq a => Eq (Inclusiveness a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: Inclusiveness a -> Inclusiveness a -> Bool Source # (/=) :: Inclusiveness a -> Inclusiveness a -> Bool Source #
Ord a => Ord (Inclusiveness a) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: Inclusiveness a -> Inclusiveness a -> Ordering Source #

(<) :: Inclusiveness a -> Inclusiveness a -> Bool Source #

(<=) :: Inclusiveness a -> Inclusiveness a -> Bool Source #

(>) :: Inclusiveness a -> Inclusiveness a -> Bool Source #

(>=) :: Inclusiveness a -> Inclusiveness a -> Bool Source #

max :: Inclusiveness a -> Inclusiveness a -> Inclusiveness a Source #

min :: Inclusiveness a -> Inclusiveness a -> Inclusiveness a Source #

Located a => Located (Inclusiveness a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: Inclusiveness a -> Loc Source # locOfList :: [Inclusiveness a] -> Loc Source #

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 Methods showsPrec :: Int -> DimIndexBase Info VName -> ShowS Source # show :: DimIndexBase Info VName -> String Source # showList :: [DimIndexBase Info VName] -> ShowS Source #
Show vn => Show (DimIndexBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DimIndexBase NoInfo vn -> ShowS Source # show :: DimIndexBase NoInfo vn -> String Source # showList :: [DimIndexBase NoInfo vn] -> ShowS Source #
ASTMappable (DimIndexBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> DimIndexBase Info VName -> m (DimIndexBase Info VName) Source #
Eq (DimIndexBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source # (/=) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #
Eq (DimIndexBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source # (/=) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #
Ord (DimIndexBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: DimIndexBase Info VName -> DimIndexBase Info VName -> Ordering Source #

(<) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #

(<=) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #

(>) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #

(>=) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #

max :: DimIndexBase Info VName -> DimIndexBase Info VName -> DimIndexBase Info VName Source #

min :: DimIndexBase Info VName -> DimIndexBase Info VName -> DimIndexBase Info VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Ordering Source #

(<) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #

(<=) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #

(>) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #

(>=) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #

max :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName Source #

min :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName Source #

(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 Source # prettyList :: [DimIndexBase f vn] -> Doc ann Source #

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

- sizeName :: !vn
- sizeLoc :: !SrcLoc

#### Instances

Instances details

Show vn => Show (SizeBinder vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> SizeBinder vn -> ShowS Source # show :: SizeBinder vn -> String Source # showList :: [SizeBinder vn] -> ShowS Source #
Eq vn => Eq (SizeBinder vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: SizeBinder vn -> SizeBinder vn -> Bool Source # (/=) :: SizeBinder vn -> SizeBinder vn -> Bool Source #
Ord vn => Ord (SizeBinder vn) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

IsName vn => Pretty (SizeBinder vn) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: SizeBinder vn -> Doc ann Source # prettyList :: [SizeBinder vn] -> Doc ann Source #
Located (SizeBinder vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: SizeBinder vn -> Loc Source # locOfList :: [SizeBinder vn] -> Loc Source #

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

Instances details

Show (AppExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> AppExpBase Info VName -> ShowS Source # show :: AppExpBase Info VName -> String Source # showList :: [AppExpBase Info VName] -> ShowS Source #
Show vn => Show (AppExpBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> AppExpBase NoInfo vn -> ShowS Source # show :: AppExpBase NoInfo vn -> String Source # showList :: [AppExpBase NoInfo vn] -> ShowS Source #
ASTMappable (AppExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> AppExpBase Info VName -> m (AppExpBase Info VName) Source #
Eq (AppExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source # (/=) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #
Eq (AppExpBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source # (/=) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #
Ord (AppExpBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: AppExpBase Info VName -> AppExpBase Info VName -> Ordering Source #

(<) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #

(<=) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #

(>) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #

(>=) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #

max :: AppExpBase Info VName -> AppExpBase Info VName -> AppExpBase Info VName Source #

min :: AppExpBase Info VName -> AppExpBase Info VName -> AppExpBase Info VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Ordering Source #

(<) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #

(<=) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #

(>) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #

(>=) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #

max :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> AppExpBase NoInfo VName Source #

min :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> AppExpBase NoInfo VName Source #

(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 Source # prettyList :: [AppExpBase f vn] -> Doc ann Source #
Located (AppExpBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: AppExpBase f vn -> Loc Source # locOfList :: [AppExpBase f vn] -> Loc Source #

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 |

Fields

- appResType :: StructType
- appResExt :: [VName]

#### Instances

Instances details

Show AppRes Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> AppRes -> ShowS Source # show :: AppRes -> String Source # showList :: [AppRes] -> ShowS Source #
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 Source # (/=) :: AppRes -> AppRes -> Bool Source #
Ord AppRes Source # |
Instance details Defined in Language.Futhark.Syntax Methods compare :: AppRes -> AppRes -> Ordering Source # (<) :: AppRes -> AppRes -> Bool Source # (<=) :: AppRes -> AppRes -> Bool Source # (>) :: AppRes -> AppRes -> Bool Source # (>=) :: AppRes -> AppRes -> Bool Source # max :: AppRes -> AppRes -> AppRes Source # min :: AppRes -> AppRes -> AppRes Source #

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.
ArrayVal [PrimValue] PrimType SrcLoc | Array value constants, where the elements are known to be constant primitives. This is a fast-path variant of `ArrayLit` that will in some cases be constructed by the parser, and also result from normalisation later on. Has exactly the same semantics as an `ArrayLit`.
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 Methods astMap :: Monad m => ASTMapper m -> ResRetType -> m ResRetType Source #
ASTMappable StructType Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> StructType -> m StructType Source #
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 Methods applySubst :: TypeSubs -> ParamType -> ParamType Source #
Substitutable StructType Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> StructType -> StructType Source #
ASTMappable (SizeExp (ExpBase Info VName)) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> SizeExp (ExpBase Info VName) -> m (SizeExp (ExpBase Info VName)) Source #
Substitutable (Pat ParamType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat ParamType -> Pat ParamType Source #
Substitutable (Pat StructType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat StructType -> Pat StructType Source #
Pretty (Shape Size) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: Shape Size -> Doc ann Source # prettyList :: [Shape Size] -> Doc ann Source #
Pretty (TypeArg Size) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: TypeArg Size -> Doc ann Source # prettyList :: [TypeArg Size] -> Doc ann Source #
Show (ExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ExpBase Info VName -> ShowS Source # show :: ExpBase Info VName -> String Source # showList :: [ExpBase Info VName] -> ShowS Source #
Show vn => Show (ExpBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ExpBase NoInfo vn -> ShowS Source # show :: ExpBase NoInfo vn -> String Source # showList :: [ExpBase NoInfo vn] -> ShowS Source #
ASTMappable (ExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> ExpBase Info VName -> m (ExpBase Info VName) Source #
ASTMappable (TypeArgExp (ExpBase Info VName) VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeArgExp (ExpBase Info VName) VName -> m (TypeArgExp (ExpBase Info VName) VName) Source #
ASTMappable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeBase Size Uniqueness -> m (TypeBase Size Uniqueness) Source #
ASTMappable (TypeExp (ExpBase Info VName) VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeExp (ExpBase Info VName) VName -> m (TypeExp (ExpBase Info VName) VName) Source #
Substitutable (RetTypeBase Size NoUniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size NoUniqueness -> RetTypeBase Size NoUniqueness Source #
Substitutable (RetTypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size Uniqueness -> RetTypeBase Size Uniqueness Source #
Substitutable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> TypeBase Size Uniqueness -> TypeBase Size Uniqueness Source #
Eq (ExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source # (/=) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #
Eq (ExpBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source # (/=) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #
Ord (ExpBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: ExpBase Info VName -> ExpBase Info VName -> Ordering Source #

(<) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #

(<=) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #

(>) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #

(>=) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #

max :: ExpBase Info VName -> ExpBase Info VName -> ExpBase Info VName Source #

min :: ExpBase Info VName -> ExpBase Info VName -> ExpBase Info VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Ordering Source #

(<) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #

(<=) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #

(>) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #

(>=) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #

max :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> ExpBase NoInfo VName Source #

min :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> ExpBase NoInfo VName Source #

(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 Source # prettyList :: [ExpBase f vn] -> Doc ann Source #
Located (ExpBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: ExpBase f vn -> Loc Source # locOfList :: [ExpBase f vn] -> Loc Source #
ASTMappable (PatBase Info VName ParamType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName ParamType -> m (PatBase Info VName ParamType) Source #
ASTMappable (PatBase Info VName StructType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName StructType -> m (PatBase Info VName StructType) Source #
ASTMappable (IdentBase Info VName StructType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> IdentBase Info VName StructType -> m (IdentBase Info VName StructType) Source #

data FieldBase f vn Source #

An entry in a record literal.

Constructors

RecordFieldExplicit (L Name) (ExpBase f vn) SrcLoc |
RecordFieldImplicit (L vn) (f StructType) SrcLoc |

#### Instances

Instances details

Show (FieldBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> FieldBase Info VName -> ShowS Source # show :: FieldBase Info VName -> String Source # showList :: [FieldBase Info VName] -> ShowS Source #
Show vn => Show (FieldBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> FieldBase NoInfo vn -> ShowS Source # show :: FieldBase NoInfo vn -> String Source # showList :: [FieldBase NoInfo vn] -> ShowS Source #
ASTMappable (FieldBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> FieldBase Info VName -> m (FieldBase Info VName) Source #
Eq (FieldBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source # (/=) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #
Eq (FieldBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source # (/=) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #
Ord (FieldBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: FieldBase Info VName -> FieldBase Info VName -> Ordering Source #

(<) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #

(<=) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #

(>) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #

(>=) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #

max :: FieldBase Info VName -> FieldBase Info VName -> FieldBase Info VName Source #

min :: FieldBase Info VName -> FieldBase Info VName -> FieldBase Info VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Ordering Source #

(<) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #

(<=) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #

(>) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #

(>=) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #

max :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> FieldBase NoInfo VName Source #

min :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> FieldBase NoInfo VName Source #

(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 Source # prettyList :: [FieldBase f vn] -> Doc ann Source #
Located (FieldBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: FieldBase f vn -> Loc Source # locOfList :: [FieldBase f vn] -> Loc Source #

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 Methods showsPrec :: Int -> CaseBase Info VName -> ShowS Source # show :: CaseBase Info VName -> String Source # showList :: [CaseBase Info VName] -> ShowS Source #
Show vn => Show (CaseBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> CaseBase NoInfo vn -> ShowS Source # show :: CaseBase NoInfo vn -> String Source # showList :: [CaseBase NoInfo vn] -> ShowS Source #
ASTMappable (CaseBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> CaseBase Info VName -> m (CaseBase Info VName) Source #
Eq (CaseBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source # (/=) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #
Eq (CaseBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source # (/=) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #
Ord (CaseBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: CaseBase Info VName -> CaseBase Info VName -> Ordering Source #

(<) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #

(<=) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #

(>) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #

(>=) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #

max :: CaseBase Info VName -> CaseBase Info VName -> CaseBase Info VName Source #

min :: CaseBase Info VName -> CaseBase Info VName -> CaseBase Info VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Ordering Source #

(<) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #

(<=) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #

(>) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #

(>=) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #

max :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> CaseBase NoInfo VName Source #

min :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> CaseBase NoInfo VName Source #

(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 Source # prettyList :: [CaseBase f vn] -> Doc ann Source #
Located (CaseBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: CaseBase f vn -> Loc Source # locOfList :: [CaseBase f vn] -> Loc Source #

data LoopInitBase f 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

Instances details

Show (LoopInitBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopInitBase Info VName -> ShowS Source # show :: LoopInitBase Info VName -> String Source # showList :: [LoopInitBase Info VName] -> ShowS Source #
Show vn => Show (LoopInitBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopInitBase NoInfo vn -> ShowS Source # show :: LoopInitBase NoInfo vn -> String Source # showList :: [LoopInitBase NoInfo vn] -> ShowS Source #
ASTMappable (LoopInitBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> LoopInitBase Info VName -> m (LoopInitBase Info VName) Source #
Eq (LoopInitBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source # (/=) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #
Eq (LoopInitBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source # (/=) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #
Ord (LoopInitBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: LoopInitBase Info VName -> LoopInitBase Info VName -> Ordering Source #

(<) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #

(<=) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #

(>) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #

(>=) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #

max :: LoopInitBase Info VName -> LoopInitBase Info VName -> LoopInitBase Info VName Source #

min :: LoopInitBase Info VName -> LoopInitBase Info VName -> LoopInitBase Info VName Source #

Ord (LoopInitBase (NoInfo :: Type -> Type) VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Ordering Source #

(<) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #

(<=) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #

(>) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #

(>=) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #

max :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName Source #

min :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName Source #

(Eq vn, IsName vn, Annot f) => Pretty (LoopInitBase f vn) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: LoopInitBase f vn -> Doc ann Source # prettyList :: [LoopInitBase f vn] -> Doc ann Source #
Located (LoopInitBase Info vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: LoopInitBase Info vn -> Loc Source # locOfList :: [LoopInitBase Info vn] -> Loc Source #

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 Methods showsPrec :: Int -> LoopFormBase Info VName -> ShowS Source # show :: LoopFormBase Info VName -> String Source # showList :: [LoopFormBase Info VName] -> ShowS Source #
Show vn => Show (LoopFormBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopFormBase NoInfo vn -> ShowS Source # show :: LoopFormBase NoInfo vn -> String Source # showList :: [LoopFormBase NoInfo vn] -> ShowS Source #
ASTMappable (LoopFormBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> LoopFormBase Info VName -> m (LoopFormBase Info VName) Source #
Eq (LoopFormBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source # (/=) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #
Eq (LoopFormBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source # (/=) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #
Ord (LoopFormBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: LoopFormBase Info VName -> LoopFormBase Info VName -> Ordering Source #

(<) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #

(<=) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #

(>) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #

(>=) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #

max :: LoopFormBase Info VName -> LoopFormBase Info VName -> LoopFormBase Info VName Source #

min :: LoopFormBase Info VName -> LoopFormBase Info VName -> LoopFormBase Info VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Ordering Source #

(<) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #

(<=) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #

(>) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #

(>=) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #

max :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName Source #

min :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName Source #

(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 Source # prettyList :: [LoopFormBase f vn] -> Doc ann Source #

data PatLit Source #

A literal in a pattern.

Constructors

PatLitInt Integer |
PatLitFloat Double |
PatLitPrim PrimValue |

#### Instances

Instances details

Show PatLit Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> PatLit -> ShowS Source # show :: PatLit -> String Source # showList :: [PatLit] -> ShowS Source #
Eq PatLit Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: PatLit -> PatLit -> Bool Source # (/=) :: PatLit -> PatLit -> Bool Source #
Ord PatLit Source # |
Instance details Defined in Language.Futhark.Syntax Methods compare :: PatLit -> PatLit -> Ordering Source # (<) :: PatLit -> PatLit -> Bool Source # (<=) :: PatLit -> PatLit -> Bool Source # (>) :: PatLit -> PatLit -> Bool Source # (>=) :: PatLit -> PatLit -> Bool Source # max :: PatLit -> PatLit -> PatLit Source # min :: PatLit -> PatLit -> PatLit Source #
Pretty PatLit Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: PatLit -> Doc ann Source # prettyList :: [PatLit] -> Doc ann Source #

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 [(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

Instances details

Substitutable (Pat ParamType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat ParamType -> Pat ParamType Source #
Substitutable (Pat StructType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat StructType -> Pat StructType Source #
Traversable f => Foldable (PatBase f vn) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

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

null :: PatBase f vn a -> Bool Source #

length :: PatBase f vn a -> Int Source #

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

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

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

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

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

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) Source # sequenceA :: Applicative f0 => PatBase f vn (f0 a) -> f0 (PatBase f vn a) Source # mapM :: Monad m => (a -> m b) -> PatBase f vn a -> m (PatBase f vn b) Source # sequence :: Monad m => PatBase f vn (m a) -> m (PatBase f vn a) Source #
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 Source # (<$) :: a -> PatBase f vn b -> PatBase f vn a Source #
Show (Info t) => Show (PatBase Info VName t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> PatBase Info VName t -> ShowS Source # show :: PatBase Info VName t -> String Source # showList :: [PatBase Info VName t] -> ShowS Source #
(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 Source # show :: PatBase NoInfo vn t -> String Source # showList :: [PatBase NoInfo vn t] -> ShowS Source #
ASTMappable (PatBase Info VName ParamType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName ParamType -> m (PatBase Info VName ParamType) Source #
ASTMappable (PatBase Info VName StructType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName StructType -> m (PatBase Info VName StructType) Source #
Eq (Info t) => Eq (PatBase Info VName t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source # (/=) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #
Eq (NoInfo t) => Eq (PatBase (NoInfo :: Type -> Type) VName t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source # (/=) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #
Ord (Info t) => Ord (PatBase Info VName t) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: PatBase Info VName t -> PatBase Info VName t -> Ordering Source #

(<) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #

(<=) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #

(>) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #

(>=) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #

max :: PatBase Info VName t -> PatBase Info VName t -> PatBase Info VName t Source #

min :: PatBase Info VName t -> PatBase Info VName t -> PatBase Info VName t Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Ordering Source #

(<) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #

(<=) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #

(>) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #

(>=) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #

max :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> PatBase NoInfo VName t Source #

min :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> PatBase NoInfo VName t Source #

(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 Source # prettyList :: [PatBase f vn t] -> Doc ann Source #
Located (PatBase f vn t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: PatBase f vn t -> Loc Source # locOfList :: [PatBase f vn t] -> Loc 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

Instances details

Show ImportName Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ImportName -> ShowS Source # show :: ImportName -> String Source # showList :: [ImportName] -> ShowS Source #
Eq ImportName Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: ImportName -> ImportName -> Bool Source # (/=) :: ImportName -> ImportName -> Bool Source #
Ord ImportName Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: ImportName -> ImportName -> Ordering Source #

(<) :: ImportName -> ImportName -> Bool Source #

(<=) :: ImportName -> ImportName -> Bool Source #

(>) :: ImportName -> ImportName -> Bool Source #

(>=) :: ImportName -> ImportName -> Bool Source #

max :: ImportName -> ImportName -> ImportName Source #

min :: ImportName -> ImportName -> ImportName Source #

data SpecBase f vn Source #

A spec is a component of a module type.

Constructors

ValSpec |

Fields

- 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 | Abstract type.
ModSpec vn (ModTypeExpBase f vn) (Maybe DocComment) SrcLoc |
IncludeSpec (ModTypeExpBase f vn) SrcLoc |

#### Instances

Instances details

Show (SpecBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> SpecBase Info VName -> ShowS Source # show :: SpecBase Info VName -> String Source # showList :: [SpecBase Info VName] -> ShowS Source #
Show (SpecBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> SpecBase NoInfo Name -> ShowS Source # show :: SpecBase NoInfo Name -> String Source # showList :: [SpecBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [SpecBase f vn] -> Doc ann Source #
Located (SpecBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: SpecBase f vn -> Loc Source # locOfList :: [SpecBase f vn] -> Loc Source #

data ModTypeExpBase f 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

Instances details

Show (ModTypeExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeExpBase Info VName -> ShowS Source # show :: ModTypeExpBase Info VName -> String Source # showList :: [ModTypeExpBase Info VName] -> ShowS Source #
Show (ModTypeExpBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeExpBase NoInfo Name -> ShowS Source # show :: ModTypeExpBase NoInfo Name -> String Source # showList :: [ModTypeExpBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [ModTypeExpBase f vn] -> Doc ann Source #
Located (ModTypeExpBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: ModTypeExpBase f vn -> Loc Source # locOfList :: [ModTypeExpBase f vn] -> Loc Source #

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 Methods showsPrec :: Int -> TypeRefBase Info VName -> ShowS Source # show :: TypeRefBase Info VName -> String Source # showList :: [TypeRefBase Info VName] -> ShowS Source #
Show (TypeRefBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeRefBase NoInfo Name -> ShowS Source # show :: TypeRefBase NoInfo Name -> String Source # showList :: [TypeRefBase NoInfo Name] -> ShowS Source #
Located (TypeRefBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: TypeRefBase f vn -> Loc Source # locOfList :: [TypeRefBase f vn] -> Loc Source #

data ModTypeBindBase f vn Source #

Module type binding.

Constructors

ModTypeBind |

Fields

- modTypeName :: vn
- modTypeExp :: ModTypeExpBase f vn
- modTypeDoc :: Maybe DocComment
- modTypeLoc :: SrcLoc

#### Instances

Instances details

Show (ModTypeBindBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeBindBase Info VName -> ShowS Source # show :: ModTypeBindBase Info VName -> String Source # showList :: [ModTypeBindBase Info VName] -> ShowS Source #
Show (ModTypeBindBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeBindBase NoInfo Name -> ShowS Source # show :: ModTypeBindBase NoInfo Name -> String Source # showList :: [ModTypeBindBase NoInfo Name] -> ShowS Source #
(Eq vn, IsName vn, Annot f) => Pretty (ModTypeBindBase f vn) Source # |
Instance details 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 # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: ModTypeBindBase f vn -> Loc Source # locOfList :: [ModTypeBindBase f vn] -> Loc Source #

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 Methods showsPrec :: Int -> ModExpBase Info VName -> ShowS Source # show :: ModExpBase Info VName -> String Source # showList :: [ModExpBase Info VName] -> ShowS Source #
Show (ModExpBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModExpBase NoInfo Name -> ShowS Source # show :: ModExpBase NoInfo Name -> String Source # showList :: [ModExpBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [ModExpBase f vn] -> Doc ann Source #
Located (ModExpBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: ModExpBase f vn -> Loc Source # locOfList :: [ModExpBase f vn] -> Loc Source #

data ModBindBase f vn Source #

A module binding.

Constructors

ModBind |

Fields

- modName :: vn
- modParams :: [ModParamBase f vn]
- modType :: Maybe (ModTypeExpBase f vn, f (Map VName VName))
- modExp :: ModExpBase f vn
- modDoc :: Maybe DocComment
- modLocation :: SrcLoc

#### Instances

Instances details

Show (ModBindBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModBindBase Info VName -> ShowS Source # show :: ModBindBase Info VName -> String Source # showList :: [ModBindBase Info VName] -> ShowS Source #
Show (ModBindBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModBindBase NoInfo Name -> ShowS Source # show :: ModBindBase NoInfo Name -> String Source # showList :: [ModBindBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [ModBindBase f vn] -> Doc ann Source #
Located (ModBindBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: ModBindBase f vn -> Loc Source # locOfList :: [ModBindBase f vn] -> Loc Source #

data ModParamBase f vn Source #

A module parameter.

Constructors

ModParam |

Fields

- modParamName :: vn
- modParamType :: ModTypeExpBase f vn
- modParamAbs :: f [VName]
- modParamLocation :: SrcLoc

#### Instances

Instances details

Show (ModParamBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModParamBase Info VName -> ShowS Source # show :: ModParamBase Info VName -> String Source # showList :: [ModParamBase Info VName] -> ShowS Source #
Show (ModParamBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModParamBase NoInfo Name -> ShowS Source # show :: ModParamBase NoInfo Name -> String Source # showList :: [ModParamBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [ModParamBase f vn] -> Doc ann Source #
Located (ModParamBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: ModParamBase f vn -> Loc Source # locOfList :: [ModParamBase f vn] -> Loc Source #

# 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 Methods showsPrec :: Int -> DocComment -> ShowS Source # show :: DocComment -> String Source # showList :: [DocComment] -> ShowS Source #
Located DocComment Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: DocComment -> Loc Source # locOfList :: [DocComment] -> Loc Source #

data ValBindBase f vn Source #

Function Declarations

Constructors

ValBind |

Fields

- valBindEntryPoint :: Maybe (f EntryPoint)

  Just if this function is an entry point. If so, it also contains the externally visible interface. Note that this may not strictly be well-typed after some desugaring operations, as it may refer to abstract types that are no longer in scope.

- valBindName :: vn
- valBindRetDecl :: Maybe (TypeExp (ExpBase f vn) vn)
- valBindRetType :: f ResRetType

  If `valBindParams` is null, then the `retDims` are brought into scope at this point.

- valBindTypeParams :: [TypeParamBase vn]
- valBindParams :: [PatBase f vn ParamType]
- valBindBody :: ExpBase f vn
- valBindDoc :: Maybe DocComment
- valBindAttrs :: [AttrInfo vn]
- valBindLocation :: SrcLoc

#### Instances

Instances details

Show (ValBindBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ValBindBase Info VName -> ShowS Source # show :: ValBindBase Info VName -> String Source # showList :: [ValBindBase Info VName] -> ShowS Source #
Show (ValBindBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ValBindBase NoInfo Name -> ShowS Source # show :: ValBindBase NoInfo Name -> String Source # showList :: [ValBindBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [ValBindBase f vn] -> Doc ann Source #
Located (ValBindBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: ValBindBase f vn -> Loc Source # locOfList :: [ValBindBase f vn] -> Loc Source #

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

- entryParams :: [EntryParam]
- entryReturn :: EntryType

#### Instances

Instances details

Show EntryPoint Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> EntryPoint -> ShowS Source # show :: EntryPoint -> String Source # showList :: [EntryPoint] -> ShowS Source #

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.

Constructors

EntryType |

Fields

- entryType :: StructType
- entryAscribed :: Maybe (TypeExp (ExpBase Info VName) VName)

#### Instances

Instances details

Show EntryType Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> EntryType -> ShowS Source # show :: EntryType -> String Source # showList :: [EntryType] -> ShowS Source #

data EntryParam Source #

A parameter of an entry point.

Constructors

EntryParam |

Fields

- entryParamName :: Name
- entryParamType :: EntryType

#### Instances

Instances details

Show EntryParam Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> EntryParam -> ShowS Source # show :: EntryParam -> String Source # showList :: [EntryParam] -> ShowS Source #

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

Instances details

Show Liftedness Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> Liftedness -> ShowS Source # show :: Liftedness -> String Source # showList :: [Liftedness] -> ShowS Source #
Eq Liftedness Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: Liftedness -> Liftedness -> Bool Source # (/=) :: Liftedness -> Liftedness -> Bool Source #
Ord Liftedness Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: Liftedness -> Liftedness -> Ordering Source #

(<) :: Liftedness -> Liftedness -> Bool Source #

(<=) :: Liftedness -> Liftedness -> Bool Source #

(>) :: Liftedness -> Liftedness -> Bool Source #

(>=) :: Liftedness -> Liftedness -> Bool Source #

max :: Liftedness -> Liftedness -> Liftedness Source #

min :: Liftedness -> Liftedness -> Liftedness Source #

Pretty Liftedness Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: Liftedness -> Doc ann Source # prettyList :: [Liftedness] -> Doc ann Source #

data TypeBindBase f vn Source #

Type Declarations

Constructors

TypeBind |

Fields

- typeAlias :: vn
- typeLiftedness :: Liftedness
- typeParams :: [TypeParamBase vn]
- typeExp :: TypeExp (ExpBase f vn) vn
- typeElab :: f StructRetType
- typeDoc :: Maybe DocComment
- typeBindLocation :: SrcLoc

#### Instances

Instances details

Show (TypeBindBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeBindBase Info VName -> ShowS Source # show :: TypeBindBase Info VName -> String Source # showList :: [TypeBindBase Info VName] -> ShowS Source #
Show (TypeBindBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeBindBase NoInfo Name -> ShowS Source # show :: TypeBindBase NoInfo Name -> String Source # showList :: [TypeBindBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [TypeBindBase f vn] -> Doc ann Source #
Located (TypeBindBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: TypeBindBase f vn -> Loc Source # locOfList :: [TypeBindBase f vn] -> Loc Source #

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

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

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

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

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

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

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

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

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

toList :: TypeParamBase a -> [a] Source #

null :: TypeParamBase a -> Bool Source #

length :: TypeParamBase a -> Int Source #

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

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

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

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

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

Traversable TypeParamBase Source # |
Instance details Defined in Language.Futhark.Syntax Methods traverse :: Applicative f => (a -> f b) -> TypeParamBase a -> f (TypeParamBase b) Source # sequenceA :: Applicative f => TypeParamBase (f a) -> f (TypeParamBase a) Source # mapM :: Monad m => (a -> m b) -> TypeParamBase a -> m (TypeParamBase b) Source # sequence :: Monad m => TypeParamBase (m a) -> m (TypeParamBase a) Source #
Functor TypeParamBase Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> TypeParamBase a -> TypeParamBase b Source # (<$) :: a -> TypeParamBase b -> TypeParamBase a Source #
Show vn => Show (TypeParamBase vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeParamBase vn -> ShowS Source # show :: TypeParamBase vn -> String Source # showList :: [TypeParamBase vn] -> ShowS Source #
Eq vn => Eq (TypeParamBase vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: TypeParamBase vn -> TypeParamBase vn -> Bool Source # (/=) :: TypeParamBase vn -> TypeParamBase vn -> Bool Source #
Ord vn => Ord (TypeParamBase vn) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: TypeParamBase vn -> TypeParamBase vn -> Ordering Source #

(<) :: TypeParamBase vn -> TypeParamBase vn -> Bool Source #

(<=) :: TypeParamBase vn -> TypeParamBase vn -> Bool Source #

(>) :: TypeParamBase vn -> TypeParamBase vn -> Bool Source #

(>=) :: TypeParamBase vn -> TypeParamBase vn -> Bool Source #

max :: TypeParamBase vn -> TypeParamBase vn -> TypeParamBase vn Source #

min :: TypeParamBase vn -> TypeParamBase vn -> TypeParamBase vn Source #

(Eq vn, IsName vn) => Pretty (TypeParamBase vn) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: TypeParamBase vn -> Doc ann Source # prettyList :: [TypeParamBase vn] -> Doc ann Source #
Located (TypeParamBase vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: TypeParamBase vn -> Loc Source # locOfList :: [TypeParamBase vn] -> Loc Source #

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

- progDoc :: Maybe DocComment
- progDecs :: [DecBase f vn]

#### Instances

Instances details

Show (ProgBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ProgBase Info VName -> ShowS Source # show :: ProgBase Info VName -> String Source # showList :: [ProgBase Info VName] -> ShowS Source #
Show (ProgBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ProgBase NoInfo Name -> ShowS Source # show :: ProgBase NoInfo Name -> String Source # showList :: [ProgBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [ProgBase f vn] -> Doc ann Source #

data DecBase f 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 |

#### Instances

Instances details

Show (DecBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DecBase Info VName -> ShowS Source # show :: DecBase Info VName -> String Source # showList :: [DecBase Info VName] -> ShowS Source #
Show (DecBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DecBase NoInfo Name -> ShowS Source # show :: DecBase NoInfo Name -> String Source # showList :: [DecBase NoInfo Name] -> ShowS Source #
(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 Source # prettyList :: [DecBase f vn] -> Doc ann Source #
Located (DecBase f vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: DecBase f vn -> Loc Source # locOfList :: [DecBase f vn] -> Loc Source #

# Miscellaneous

data L a Source #

A value of type `L a` is a value of type `a` with an associated `Loc`, but this location is ignored when performing comparisons.

Constructors

L Loc a |

#### Instances

Instances details

Functor L |
Instance details Defined in Data.Loc Methods fmap :: (a -> b) -> L a -> L b Source # (<$) :: a -> L b -> L a Source #
Data a => Data (L a) |

Instance details

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

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (L a) Source #

toConstr :: L a -> Constr Source #

dataTypeOf :: L a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (L a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (L a)) Source #

gmapT :: (forall b. Data b => b -> b) -> L a -> L a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> L a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> L a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> L a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> L a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> L a -> m (L a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> L a -> m (L a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> L a -> m (L a) Source #

Show x => Show (L x) |
Instance details Defined in Data.Loc Methods showsPrec :: Int -> L x -> ShowS Source # show :: L x -> String Source # showList :: [L x] -> ShowS Source #
Eq x => Eq (L x) |
Instance details Defined in Data.Loc Methods (==) :: L x -> L x -> Bool Source # (/=) :: L x -> L x -> Bool Source #
Ord x => Ord (L x) |
Instance details Defined in Data.Loc Methods compare :: L x -> L x -> Ordering Source # (<) :: L x -> L x -> Bool Source # (<=) :: L x -> L x -> Bool Source # (>) :: L x -> L x -> Bool Source # (>=) :: L x -> L x -> Bool Source # max :: L x -> L x -> L x Source # min :: L x -> L x -> L x Source #
Pretty x => Pretty (L x) |
Instance details Defined in Text.PrettyPrint.Mainland.Class Methods ppr :: L x -> Doc Source # pprPrec :: Int -> L x -> Doc Source # pprList :: [L x] -> Doc Source #
Located (L a) |
Instance details Defined in Data.Loc Methods locOf :: L a -> Loc Source # locOfList :: [L a] -> Loc Source #
Relocatable (L a) |
Instance details Defined in Data.Loc Methods reloc :: Loc -> L a -> L a Source #

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

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

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

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

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

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

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

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

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

toList :: NoInfo a -> [a] Source #

null :: NoInfo a -> Bool Source #

length :: NoInfo a -> Int Source #

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

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

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

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

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

Traversable (NoInfo :: Type -> Type) Source # |
Instance details Defined in Language.Futhark.Syntax Methods traverse :: Applicative f => (a -> f b) -> NoInfo a -> f (NoInfo b) Source # sequenceA :: Applicative f => NoInfo (f a) -> f (NoInfo a) Source # mapM :: Monad m => (a -> m b) -> NoInfo a -> m (NoInfo b) Source # sequence :: Monad m => NoInfo (m a) -> m (NoInfo a) Source #
Functor (NoInfo :: Type -> Type) Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> NoInfo a -> NoInfo b Source # (<$) :: a -> NoInfo b -> NoInfo a Source #
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 Methods showsPrec :: Int -> AppExpBase NoInfo vn -> ShowS Source # show :: AppExpBase NoInfo vn -> String Source # showList :: [AppExpBase NoInfo vn] -> ShowS Source #
Show vn => Show (CaseBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> CaseBase NoInfo vn -> ShowS Source # show :: CaseBase NoInfo vn -> String Source # showList :: [CaseBase NoInfo vn] -> ShowS Source #
Show (DecBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DecBase NoInfo Name -> ShowS Source # show :: DecBase NoInfo Name -> String Source # showList :: [DecBase NoInfo Name] -> ShowS Source #
Show vn => Show (DimIndexBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DimIndexBase NoInfo vn -> ShowS Source # show :: DimIndexBase NoInfo vn -> String Source # showList :: [DimIndexBase NoInfo vn] -> ShowS Source #
Show vn => Show (ExpBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ExpBase NoInfo vn -> ShowS Source # show :: ExpBase NoInfo vn -> String Source # showList :: [ExpBase NoInfo vn] -> ShowS Source #
Show vn => Show (FieldBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> FieldBase NoInfo vn -> ShowS Source # show :: FieldBase NoInfo vn -> String Source # showList :: [FieldBase NoInfo vn] -> ShowS Source #
Show vn => Show (LoopFormBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopFormBase NoInfo vn -> ShowS Source # show :: LoopFormBase NoInfo vn -> String Source # showList :: [LoopFormBase NoInfo vn] -> ShowS Source #
Show vn => Show (LoopInitBase (NoInfo :: Type -> Type) vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopInitBase NoInfo vn -> ShowS Source # show :: LoopInitBase NoInfo vn -> String Source # showList :: [LoopInitBase NoInfo vn] -> ShowS Source #
Show (ModBindBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModBindBase NoInfo Name -> ShowS Source # show :: ModBindBase NoInfo Name -> String Source # showList :: [ModBindBase NoInfo Name] -> ShowS Source #
Show (ModExpBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModExpBase NoInfo Name -> ShowS Source # show :: ModExpBase NoInfo Name -> String Source # showList :: [ModExpBase NoInfo Name] -> ShowS Source #
Show (ModParamBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModParamBase NoInfo Name -> ShowS Source # show :: ModParamBase NoInfo Name -> String Source # showList :: [ModParamBase NoInfo Name] -> ShowS Source #
Show (ModTypeBindBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeBindBase NoInfo Name -> ShowS Source # show :: ModTypeBindBase NoInfo Name -> String Source # showList :: [ModTypeBindBase NoInfo Name] -> ShowS Source #
Show (ModTypeExpBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeExpBase NoInfo Name -> ShowS Source # show :: ModTypeExpBase NoInfo Name -> String Source # showList :: [ModTypeExpBase NoInfo Name] -> ShowS Source #
Show (NoInfo a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> NoInfo a -> ShowS Source # show :: NoInfo a -> String Source # showList :: [NoInfo a] -> ShowS Source #
Show (ProgBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ProgBase NoInfo Name -> ShowS Source # show :: ProgBase NoInfo Name -> String Source # showList :: [ProgBase NoInfo Name] -> ShowS Source #
Show (SpecBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> SpecBase NoInfo Name -> ShowS Source # show :: SpecBase NoInfo Name -> String Source # showList :: [SpecBase NoInfo Name] -> ShowS Source #
Show (TypeBindBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeBindBase NoInfo Name -> ShowS Source # show :: TypeBindBase NoInfo Name -> String Source # showList :: [TypeBindBase NoInfo Name] -> ShowS Source #
Show (TypeRefBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeRefBase NoInfo Name -> ShowS Source # show :: TypeRefBase NoInfo Name -> String Source # showList :: [TypeRefBase NoInfo Name] -> ShowS Source #
Show (ValBindBase (NoInfo :: Type -> Type) Name) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ValBindBase NoInfo Name -> ShowS Source # show :: ValBindBase NoInfo Name -> String Source # showList :: [ValBindBase NoInfo Name] -> ShowS Source #
Eq (AppExpBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source # (/=) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #
Eq (CaseBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source # (/=) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #
Eq (DimIndexBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source # (/=) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #
Eq (ExpBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source # (/=) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #
Eq (FieldBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source # (/=) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #
Eq (LoopFormBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source # (/=) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #
Eq (LoopInitBase (NoInfo :: Type -> Type) VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source # (/=) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #
Eq (NoInfo a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: NoInfo a -> NoInfo a -> Bool Source # (/=) :: NoInfo a -> NoInfo a -> Bool Source #
Ord (AppExpBase (NoInfo :: Type -> Type) VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Ordering Source #

(<) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #

(<=) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #

(>) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #

(>=) :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> Bool Source #

max :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> AppExpBase NoInfo VName Source #

min :: AppExpBase NoInfo VName -> AppExpBase NoInfo VName -> AppExpBase NoInfo VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Ordering Source #

(<) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #

(<=) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #

(>) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #

(>=) :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> Bool Source #

max :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> CaseBase NoInfo VName Source #

min :: CaseBase NoInfo VName -> CaseBase NoInfo VName -> CaseBase NoInfo VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Ordering Source #

(<) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #

(<=) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #

(>) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #

(>=) :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> Bool Source #

max :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName Source #

min :: DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName -> DimIndexBase NoInfo VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Ordering Source #

(<) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #

(<=) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #

(>) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #

(>=) :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> Bool Source #

max :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> ExpBase NoInfo VName Source #

min :: ExpBase NoInfo VName -> ExpBase NoInfo VName -> ExpBase NoInfo VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Ordering Source #

(<) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #

(<=) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #

(>) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #

(>=) :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> Bool Source #

max :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> FieldBase NoInfo VName Source #

min :: FieldBase NoInfo VName -> FieldBase NoInfo VName -> FieldBase NoInfo VName Source #

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

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Ordering Source #

(<) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #

(<=) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #

(>) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #

(>=) :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> Bool Source #

max :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName Source #

min :: LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName -> LoopFormBase NoInfo VName Source #

Ord (LoopInitBase (NoInfo :: Type -> Type) VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Ordering Source #

(<) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #

(<=) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #

(>) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #

(>=) :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> Bool Source #

max :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName Source #

min :: LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName -> LoopInitBase NoInfo VName Source #

Ord (NoInfo a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods compare :: NoInfo a -> NoInfo a -> Ordering Source # (<) :: NoInfo a -> NoInfo a -> Bool Source # (<=) :: NoInfo a -> NoInfo a -> Bool Source # (>) :: NoInfo a -> NoInfo a -> Bool Source # (>=) :: NoInfo a -> NoInfo a -> Bool Source # max :: NoInfo a -> NoInfo a -> NoInfo a Source # min :: NoInfo a -> NoInfo a -> NoInfo a Source #
(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 Source # show :: PatBase NoInfo vn t -> String Source # showList :: [PatBase NoInfo vn t] -> ShowS Source #
Eq (NoInfo t) => Eq (PatBase (NoInfo :: Type -> Type) VName t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source # (/=) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #
Ord (NoInfo t) => Ord (PatBase (NoInfo :: Type -> Type) VName t) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Ordering Source #

(<) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #

(<=) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #

(>) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #

(>=) :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> Bool Source #

max :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> PatBase NoInfo VName t Source #

min :: PatBase NoInfo VName t -> PatBase NoInfo VName t -> PatBase NoInfo VName t Source #

(Show (Info t), Show vn) => Show (IdentBase (NoInfo :: Type -> Type) vn t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> IdentBase NoInfo vn t -> ShowS Source # show :: IdentBase NoInfo vn t -> String Source # showList :: [IdentBase NoInfo vn t] -> ShowS Source #

newtype Info a Source #

Some information. The dual to `NoInfo`

Constructors

Info |

Fields

- unInfo :: a

#### Instances

Instances details

Foldable Info Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

toList :: Info a -> [a] Source #

null :: Info a -> Bool Source #

length :: Info a -> Int Source #

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

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

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

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

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

Traversable Info Source # |
Instance details Defined in Language.Futhark.Syntax Methods traverse :: Applicative f => (a -> f b) -> Info a -> f (Info b) Source # sequenceA :: Applicative f => Info (f a) -> f (Info a) Source # mapM :: Monad m => (a -> m b) -> Info a -> m (Info b) Source # sequence :: Monad m => Info (m a) -> m (Info a) Source #
Functor Info Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> Info a -> Info b Source # (<$) :: a -> Info b -> Info a Source #
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 Methods astMap :: Monad m => ASTMapper m -> ResRetType -> m ResRetType Source #
ASTMappable StructType Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> StructType -> m StructType Source #
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 Methods applySubst :: TypeSubs -> ParamType -> ParamType Source #
Substitutable StructType Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> StructType -> StructType Source #
Show a => Show (Info a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> Info a -> ShowS Source # show :: Info a -> String Source # showList :: [Info a] -> ShowS Source #
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 Methods astMap :: Monad m => ASTMapper m -> SizeExp (ExpBase Info VName) -> m (SizeExp (ExpBase Info VName)) Source #
Substitutable (Pat ParamType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat ParamType -> Pat ParamType Source #
Substitutable (Pat StructType) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> Pat StructType -> Pat StructType Source #
Eq a => Eq (Info a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: Info a -> Info a -> Bool Source # (/=) :: Info a -> Info a -> Bool Source #
Ord a => Ord (Info a) Source # |
Instance details Defined in Language.Futhark.Syntax Methods compare :: Info a -> Info a -> Ordering Source # (<) :: Info a -> Info a -> Bool Source # (<=) :: Info a -> Info a -> Bool Source # (>) :: Info a -> Info a -> Bool Source # (>=) :: Info a -> Info a -> Bool Source # max :: Info a -> Info a -> Info a Source # min :: Info a -> Info a -> Info a Source #
Pretty (Shape Size) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: Shape Size -> Doc ann Source # prettyList :: [Shape Size] -> Doc ann Source #
Pretty (TypeArg Size) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: TypeArg Size -> Doc ann Source # prettyList :: [TypeArg Size] -> Doc ann Source #
Show (AppExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> AppExpBase Info VName -> ShowS Source # show :: AppExpBase Info VName -> String Source # showList :: [AppExpBase Info VName] -> ShowS Source #
Show (CaseBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> CaseBase Info VName -> ShowS Source # show :: CaseBase Info VName -> String Source # showList :: [CaseBase Info VName] -> ShowS Source #
Show (DecBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DecBase Info VName -> ShowS Source # show :: DecBase Info VName -> String Source # showList :: [DecBase Info VName] -> ShowS Source #
Show (DimIndexBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> DimIndexBase Info VName -> ShowS Source # show :: DimIndexBase Info VName -> String Source # showList :: [DimIndexBase Info VName] -> ShowS Source #
Show (ExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ExpBase Info VName -> ShowS Source # show :: ExpBase Info VName -> String Source # showList :: [ExpBase Info VName] -> ShowS Source #
Show (FieldBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> FieldBase Info VName -> ShowS Source # show :: FieldBase Info VName -> String Source # showList :: [FieldBase Info VName] -> ShowS Source #
Show (LoopFormBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopFormBase Info VName -> ShowS Source # show :: LoopFormBase Info VName -> String Source # showList :: [LoopFormBase Info VName] -> ShowS Source #
Show (LoopInitBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> LoopInitBase Info VName -> ShowS Source # show :: LoopInitBase Info VName -> String Source # showList :: [LoopInitBase Info VName] -> ShowS Source #
Show (ModBindBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModBindBase Info VName -> ShowS Source # show :: ModBindBase Info VName -> String Source # showList :: [ModBindBase Info VName] -> ShowS Source #
Show (ModExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModExpBase Info VName -> ShowS Source # show :: ModExpBase Info VName -> String Source # showList :: [ModExpBase Info VName] -> ShowS Source #
Show (ModParamBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModParamBase Info VName -> ShowS Source # show :: ModParamBase Info VName -> String Source # showList :: [ModParamBase Info VName] -> ShowS Source #
Show (ModTypeBindBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeBindBase Info VName -> ShowS Source # show :: ModTypeBindBase Info VName -> String Source # showList :: [ModTypeBindBase Info VName] -> ShowS Source #
Show (ModTypeExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ModTypeExpBase Info VName -> ShowS Source # show :: ModTypeExpBase Info VName -> String Source # showList :: [ModTypeExpBase Info VName] -> ShowS Source #
Show (ProgBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ProgBase Info VName -> ShowS Source # show :: ProgBase Info VName -> String Source # showList :: [ProgBase Info VName] -> ShowS Source #
Show (SpecBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> SpecBase Info VName -> ShowS Source # show :: SpecBase Info VName -> String Source # showList :: [SpecBase Info VName] -> ShowS Source #
Show (TypeBindBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeBindBase Info VName -> ShowS Source # show :: TypeBindBase Info VName -> String Source # showList :: [TypeBindBase Info VName] -> ShowS Source #
Show (TypeRefBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> TypeRefBase Info VName -> ShowS Source # show :: TypeRefBase Info VName -> String Source # showList :: [TypeRefBase Info VName] -> ShowS Source #
Show (ValBindBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> ValBindBase Info VName -> ShowS Source # show :: ValBindBase Info VName -> String Source # showList :: [ValBindBase Info VName] -> ShowS Source #
ASTMappable (AppExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> AppExpBase Info VName -> m (AppExpBase Info VName) Source #
ASTMappable (CaseBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> CaseBase Info VName -> m (CaseBase Info VName) Source #
ASTMappable (DimIndexBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> DimIndexBase Info VName -> m (DimIndexBase Info VName) Source #
ASTMappable (ExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> ExpBase Info VName -> m (ExpBase Info VName) Source #
ASTMappable (FieldBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> FieldBase Info VName -> m (FieldBase Info VName) Source #
ASTMappable (LoopFormBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> LoopFormBase Info VName -> m (LoopFormBase Info VName) Source #
ASTMappable (LoopInitBase Info VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> LoopInitBase Info VName -> m (LoopInitBase Info VName) Source #
ASTMappable (TypeArgExp (ExpBase Info VName) VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeArgExp (ExpBase Info VName) VName -> m (TypeArgExp (ExpBase Info VName) VName) Source #
ASTMappable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeBase Size Uniqueness -> m (TypeBase Size Uniqueness) Source #
ASTMappable (TypeExp (ExpBase Info VName) VName) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> TypeExp (ExpBase Info VName) VName -> m (TypeExp (ExpBase Info VName) VName) Source #
Substitutable (RetTypeBase Size NoUniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size NoUniqueness -> RetTypeBase Size NoUniqueness Source #
Substitutable (RetTypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> RetTypeBase Size Uniqueness -> RetTypeBase Size Uniqueness Source #
Substitutable (TypeBase Size Uniqueness) Source # |
Instance details Defined in Language.Futhark.TypeChecker.Types Methods applySubst :: TypeSubs -> TypeBase Size Uniqueness -> TypeBase Size Uniqueness Source #
Eq (AppExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source # (/=) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #
Eq (CaseBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source # (/=) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #
Eq (DimIndexBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source # (/=) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #
Eq (ExpBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source # (/=) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #
Eq (FieldBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source # (/=) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #
Eq (LoopFormBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source # (/=) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #
Eq (LoopInitBase Info VName) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source # (/=) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #
Ord (AppExpBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: AppExpBase Info VName -> AppExpBase Info VName -> Ordering Source #

(<) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #

(<=) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #

(>) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #

(>=) :: AppExpBase Info VName -> AppExpBase Info VName -> Bool Source #

max :: AppExpBase Info VName -> AppExpBase Info VName -> AppExpBase Info VName Source #

min :: AppExpBase Info VName -> AppExpBase Info VName -> AppExpBase Info VName Source #

Ord (CaseBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: CaseBase Info VName -> CaseBase Info VName -> Ordering Source #

(<) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #

(<=) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #

(>) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #

(>=) :: CaseBase Info VName -> CaseBase Info VName -> Bool Source #

max :: CaseBase Info VName -> CaseBase Info VName -> CaseBase Info VName Source #

min :: CaseBase Info VName -> CaseBase Info VName -> CaseBase Info VName Source #

Ord (DimIndexBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: DimIndexBase Info VName -> DimIndexBase Info VName -> Ordering Source #

(<) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #

(<=) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #

(>) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #

(>=) :: DimIndexBase Info VName -> DimIndexBase Info VName -> Bool Source #

max :: DimIndexBase Info VName -> DimIndexBase Info VName -> DimIndexBase Info VName Source #

min :: DimIndexBase Info VName -> DimIndexBase Info VName -> DimIndexBase Info VName Source #

Ord (ExpBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: ExpBase Info VName -> ExpBase Info VName -> Ordering Source #

(<) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #

(<=) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #

(>) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #

(>=) :: ExpBase Info VName -> ExpBase Info VName -> Bool Source #

max :: ExpBase Info VName -> ExpBase Info VName -> ExpBase Info VName Source #

min :: ExpBase Info VName -> ExpBase Info VName -> ExpBase Info VName Source #

Ord (FieldBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: FieldBase Info VName -> FieldBase Info VName -> Ordering Source #

(<) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #

(<=) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #

(>) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #

(>=) :: FieldBase Info VName -> FieldBase Info VName -> Bool Source #

max :: FieldBase Info VName -> FieldBase Info VName -> FieldBase Info VName Source #

min :: FieldBase Info VName -> FieldBase Info VName -> FieldBase Info VName Source #

Ord (LoopFormBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: LoopFormBase Info VName -> LoopFormBase Info VName -> Ordering Source #

(<) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #

(<=) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #

(>) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #

(>=) :: LoopFormBase Info VName -> LoopFormBase Info VName -> Bool Source #

max :: LoopFormBase Info VName -> LoopFormBase Info VName -> LoopFormBase Info VName Source #

min :: LoopFormBase Info VName -> LoopFormBase Info VName -> LoopFormBase Info VName Source #

Ord (LoopInitBase Info VName) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: LoopInitBase Info VName -> LoopInitBase Info VName -> Ordering Source #

(<) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #

(<=) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #

(>) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #

(>=) :: LoopInitBase Info VName -> LoopInitBase Info VName -> Bool Source #

max :: LoopInitBase Info VName -> LoopInitBase Info VName -> LoopInitBase Info VName Source #

min :: LoopInitBase Info VName -> LoopInitBase Info VName -> LoopInitBase Info VName Source #

Located (LoopInitBase Info vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods locOf :: LoopInitBase Info vn -> Loc Source # locOfList :: [LoopInitBase Info vn] -> Loc Source #
Show (Info t) => Show (PatBase Info VName t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> PatBase Info VName t -> ShowS Source # show :: PatBase Info VName t -> String Source # showList :: [PatBase Info VName t] -> ShowS Source #
ASTMappable (PatBase Info VName ParamType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName ParamType -> m (PatBase Info VName ParamType) Source #
ASTMappable (PatBase Info VName StructType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> PatBase Info VName StructType -> m (PatBase Info VName StructType) Source #
Eq (Info t) => Eq (PatBase Info VName t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source # (/=) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #
Ord (Info t) => Ord (PatBase Info VName t) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

compare :: PatBase Info VName t -> PatBase Info VName t -> Ordering Source #

(<) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #

(<=) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #

(>) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #

(>=) :: PatBase Info VName t -> PatBase Info VName t -> Bool Source #

max :: PatBase Info VName t -> PatBase Info VName t -> PatBase Info VName t Source #

min :: PatBase Info VName t -> PatBase Info VName t -> PatBase Info VName t Source #

Show (Info t) => Show (IdentBase Info VName t) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> IdentBase Info VName t -> ShowS Source # show :: IdentBase Info VName t -> String Source # showList :: [IdentBase Info VName t] -> ShowS Source #
ASTMappable (IdentBase Info VName StructType) Source # |
Instance details Defined in Language.Futhark.Traversals Methods astMap :: Monad m => ASTMapper m -> IdentBase Info VName StructType -> m (IdentBase Info VName StructType) Source #

data QualName vn Source #

A name qualified with a breadcrumb of module accesses.

Constructors

QualName |

Fields

- qualQuals :: ![vn]
- qualLeaf :: !vn

#### Instances

Instances details

Foldable QualName Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

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

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

toList :: QualName a -> [a] Source #

null :: QualName a -> Bool Source #

length :: QualName a -> Int Source #

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

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

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

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

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

Traversable QualName Source # |
Instance details Defined in Language.Futhark.Syntax Methods traverse :: Applicative f => (a -> f b) -> QualName a -> f (QualName b) Source # sequenceA :: Applicative f => QualName (f a) -> f (QualName a) Source # mapM :: Monad m => (a -> m b) -> QualName a -> m (QualName b) Source # sequence :: Monad m => QualName (m a) -> m (QualName a) Source #
Functor QualName Source # |
Instance details Defined in Language.Futhark.Syntax Methods fmap :: (a -> b) -> QualName a -> QualName b Source # (<$) :: a -> QualName b -> QualName a Source #
Show vn => Show (QualName vn) Source # |
Instance details Defined in Language.Futhark.Syntax Methods showsPrec :: Int -> QualName vn -> ShowS Source # show :: QualName vn -> String Source # showList :: [QualName vn] -> ShowS Source #
Eq v => Eq (QualName v) Source # |
Instance details Defined in Language.Futhark.Syntax Methods (==) :: QualName v -> QualName v -> Bool Source # (/=) :: QualName v -> QualName v -> Bool Source #
Ord v => Ord (QualName v) Source # |

Instance details

Defined in Language.Futhark.Syntax

Methods

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

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

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

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

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

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

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

IsName vn => Pretty (QualName vn) Source # |
Instance details Defined in Language.Futhark.Pretty Methods pretty :: QualName vn -> Doc ann Source # prettyList :: [QualName vn] -> Doc ann 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 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.

loopInitExp :: LoopInitBase Info VName -> ExpBase Info VName Source #