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

Language.Futhark.Semantic

Description

Definitions of various semantic objects (*not* the Futhark semantics themselves).

Synopsis

Documentation

data ImportName Source #

Canonical reference to a Futhark code file. Does not include the .fut extension. This is most often a path relative to the current working directory of the compiler.

mkInitialImport :: FilePath -> ImportName Source #

Create an import name immediately from a file path specified by the user.

mkImportFrom :: ImportName -> String -> SrcLoc -> ImportName Source #

We resolve '..' paths here and assume that no shenanigans are going on with symbolic links. If there is, too bad. Don't do that.

includeToFilePath :: ImportName -> FilePath Source #

Create a .fut file corresponding to an ImportName.

includeToString :: ImportName -> String Source #

Produce a human-readable canonicalized string from an ImportName.

data FileModule Source #

The result of type checking some file. Can be passed to further invocations of the type checker.

Constructors

FileModule 

Fields

type Imports = [(String, FileModule)] Source #

A mapping from import names to imports. The ordering is significant.

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

type NameMap = Map (Namespace, Name) (QualName VName) Source #

A mapping from names (which always exist in some namespace) to a unique (tagged) name.

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. We allow a return type here to support type abbreviations that hide some inner sizes (these must necessarily be Lifted or SizeLifted).

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 #