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

Language.Futhark.TypeChecker.Monad

Description

Main monad in which the type checker runs, as well as ancillary data definitions.

Synopsis

Documentation

data TypeM a Source #

The type checker runs in this monad.

Instances

Instances details
Monad TypeM Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

(>>=) :: TypeM a -> (a -> TypeM b) -> TypeM b #

(>>) :: TypeM a -> TypeM b -> TypeM b #

return :: a -> TypeM a #

Functor TypeM Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

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

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

Applicative TypeM Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

pure :: a -> TypeM a #

(<*>) :: TypeM (a -> b) -> TypeM a -> TypeM b #

liftA2 :: (a -> b -> c) -> TypeM a -> TypeM b -> TypeM c #

(*>) :: TypeM a -> TypeM b -> TypeM b #

(<*) :: TypeM a -> TypeM b -> TypeM a #

MonadTypeChecker TypeM Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

MonadWriter Warnings TypeM Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

writer :: (a, Warnings) -> TypeM a #

tell :: Warnings -> TypeM () #

listen :: TypeM a -> TypeM (a, Warnings) #

pass :: TypeM (a, Warnings -> Warnings) -> TypeM a #

MonadState VNameSource TypeM Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

MonadError TypeError TypeM Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

throwError :: TypeError -> TypeM a #

catchError :: TypeM a -> (TypeError -> TypeM a) -> TypeM a #

askImportName :: TypeM ImportName Source #

The name of the current file/import.

bindSpaced :: MonadTypeChecker m => [(Namespace, Name)] -> m a -> m a Source #

qualifyTypeVars :: ASTMappable t => Env -> [VName] -> [VName] -> t -> t Source #

data TypeError Source #

Information about an error during type checking.

Constructors

TypeError SrcLoc Notes Doc 

Instances

Instances details
Pretty TypeError Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

MonadError TypeError TypeM Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

throwError :: TypeError -> TypeM a #

catchError :: TypeM a -> (TypeError -> TypeM a) -> TypeM a #

data Notes Source #

Instances

Instances details
Semigroup Notes Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

(<>) :: Notes -> Notes -> Notes #

sconcat :: NonEmpty Notes -> Notes #

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

Monoid Notes Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

mempty :: Notes #

mappend :: Notes -> Notes -> Notes #

mconcat :: [Notes] -> Notes #

Pretty Notes Source # 
Instance details

Defined in Language.Futhark.TypeChecker.Monad

Methods

ppr :: Notes -> Doc

pprPrec :: Int -> Notes -> Doc

pprList :: [Notes] -> Doc

aNote :: Pretty a => a -> Notes Source #

class Monad m => MonadTypeChecker m where Source #

Methods

warn :: Located loc => loc -> String -> m () Source #

newName :: VName -> m VName Source #

newID :: Name -> m VName Source #

bindNameMap :: NameMap -> m a -> m a Source #

bindVal :: VName -> BoundV -> m a -> m a Source #

checkQualName :: Namespace -> QualName Name -> SrcLoc -> m (QualName VName) Source #

lookupType :: SrcLoc -> QualName Name -> m (QualName VName, [TypeParam], StructType, Liftedness) Source #

lookupMod :: SrcLoc -> QualName Name -> m (QualName VName, Mod) Source #

lookupVar :: SrcLoc -> QualName Name -> m (QualName VName, PatternType) Source #

checkNamedDim :: SrcLoc -> QualName Name -> m (QualName VName) Source #

typeError :: Located loc => loc -> Notes -> Doc -> m a Source #

data Env Source #

Modules produces environment with this representation.

Instances

Instances details
Show Env Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

showsPrec :: Int -> Env -> ShowS #

show :: Env -> String #

showList :: [Env] -> ShowS #

Semigroup Env Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

(<>) :: Env -> Env -> Env #

sconcat :: NonEmpty Env -> Env #

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

Monoid Env Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

mempty :: Env #

mappend :: Env -> Env -> Env #

mconcat :: [Env] -> Env #

Pretty Env Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

ppr :: Env -> Doc

pprPrec :: Int -> Env -> Doc

pprList :: [Env] -> Doc

type TySet = Map (QualName VName) Liftedness Source #

A mapping of abstract types to their liftedness.

data FunSig Source #

A parametric functor consists of a set of abstract types, the environment of its parameter, and the resulting module type.

Constructors

FunSig 

Instances

Instances details
Show FunSig Source # 
Instance details

Defined in Language.Futhark.Semantic

data BoundV Source #

Type parameters, list of parameter types (optinally named), and return type. The type parameters are in scope in both parameter types and the return type. Non-functional values have only a return type.

Constructors

BoundV [TypeParam] StructType 

Instances

Instances details
Show BoundV Source # 
Instance details

Defined in Language.Futhark.Semantic

data Mod Source #

Representation of a module, which is either a plain environment, or a parametric module ("functor" in SML).

Constructors

ModEnv Env 
ModFun FunSig 

Instances

Instances details
Show Mod Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

showsPrec :: Int -> Mod -> ShowS #

show :: Mod -> String #

showList :: [Mod] -> ShowS #

Pretty Mod Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

ppr :: Mod -> Doc

pprPrec :: Int -> Mod -> Doc

pprList :: [Mod] -> Doc

data TypeBinding Source #

A binding from a name to its definition as a type.

Instances

Instances details
Eq TypeBinding Source # 
Instance details

Defined in Language.Futhark.Semantic

Show TypeBinding Source # 
Instance details

Defined in Language.Futhark.Semantic

data MTy Source #

Representation of a module type.

Constructors

MTy 

Fields

Instances

Instances details
Show MTy Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

showsPrec :: Int -> MTy -> ShowS #

show :: MTy -> String #

showList :: [MTy] -> ShowS #

Pretty MTy Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

ppr :: MTy -> Doc

pprPrec :: Int -> MTy -> Doc

pprList :: [MTy] -> Doc

data Namespace Source #

The space inhabited by a name.

Constructors

Term

Functions and values.

Type 
Signature