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

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

mkInitialImport :: FilePath -> ImportName Source #

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

mkImportFrom :: ImportName -> String -> 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.

includeToText :: ImportName -> Text Source #

Produce a human-readable canonicalized text 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 = [(ImportName, FileModule)] Source #

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

data Namespace Source #

The space inhabited by a name.

Constructors

Term

Functions and values.

Type 
Signature 

data Env Source #

Modules produces environment with this representation.

Instances

Instances details
Monoid Env Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

mempty :: Env #

mappend :: Env -> Env -> Env #

mconcat :: [Env] -> Env #

Semigroup Env Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

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

sconcat :: NonEmpty Env -> Env #

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

Show Env Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

showsPrec :: Int -> Env -> ShowS #

show :: Env -> String #

showList :: [Env] -> ShowS #

Pretty Env Source # 
Instance details

Defined in Language.Futhark.Semantic

Methods

pretty :: Env -> Doc ann #

prettyList :: [Env] -> Doc ann #

type TySet = Map (QualName VName) Liftedness Source #

A mapping of abstract types to their liftedness.

data FunModType Source #

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

Instances

Instances details
Show FunModType 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.

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 FunModType 

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

pretty :: Mod -> Doc ann #

prettyList :: [Mod] -> Doc ann #

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

Defined in Language.Futhark.Semantic

Eq 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

pretty :: MTy -> Doc ann #

prettyList :: [MTy] -> Doc ann #