Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Definitions of various semantic objects (*not* the Futhark semantics themselves).
Synopsis
- data ImportName
- mkInitialImport :: FilePath -> ImportName
- mkImportFrom :: ImportName -> String -> ImportName
- includeToFilePath :: ImportName -> FilePath
- includeToString :: ImportName -> String
- includeToText :: ImportName -> Text
- data FileModule = FileModule {}
- type Imports = [(ImportName, FileModule)]
- data Namespace
- data Env = Env {}
- type TySet = Map (QualName VName) Liftedness
- data FunModType = FunModType {}
- type NameMap = Map (Namespace, Name) (QualName VName)
- data BoundV = BoundV {}
- data Mod
- data TypeBinding = TypeAbbr Liftedness [TypeParam] StructRetType
- data MTy = MTy {}
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.
Instances
Show ImportName Source # | |
Defined in Language.Futhark.Syntax showsPrec :: Int -> ImportName -> ShowS # show :: ImportName -> String # showList :: [ImportName] -> ShowS # | |
Eq ImportName Source # | |
Defined in Language.Futhark.Syntax (==) :: ImportName -> ImportName -> Bool # (/=) :: ImportName -> ImportName -> Bool # | |
Ord ImportName Source # | |
Defined in Language.Futhark.Syntax compare :: ImportName -> ImportName -> Ordering # (<) :: ImportName -> ImportName -> Bool # (<=) :: ImportName -> ImportName -> Bool # (>) :: ImportName -> ImportName -> Bool # (>=) :: ImportName -> ImportName -> Bool # max :: ImportName -> ImportName -> ImportName # min :: ImportName -> ImportName -> ImportName # |
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.
type Imports = [(ImportName, FileModule)] Source #
A mapping from import names to imports. The ordering is significant.
The space inhabited by a name.
Instances
Enum Namespace Source # | |
Defined in Language.Futhark.Semantic succ :: Namespace -> Namespace # pred :: Namespace -> Namespace # fromEnum :: Namespace -> Int # enumFrom :: Namespace -> [Namespace] # enumFromThen :: Namespace -> Namespace -> [Namespace] # enumFromTo :: Namespace -> Namespace -> [Namespace] # enumFromThenTo :: Namespace -> Namespace -> Namespace -> [Namespace] # | |
Show Namespace Source # | |
Eq Namespace Source # | |
Ord Namespace Source # | |
Defined in Language.Futhark.Semantic | |
Pretty Namespace Source # | |
Defined in Language.Futhark.Semantic |
Modules produces environment with this representation.
Env | |
|
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.
FunModType | |
|
Instances
Show FunModType Source # | |
Defined in Language.Futhark.Semantic showsPrec :: Int -> FunModType -> ShowS # show :: FunModType -> String # showList :: [FunModType] -> ShowS # |
type NameMap = Map (Namespace, Name) (QualName VName) Source #
A mapping from names (which always exist in some namespace) to a unique (tagged) name.
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.
Representation of a module, which is either a plain environment, or a parametric module ("functor" in SML).
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
Show TypeBinding Source # | |
Defined in Language.Futhark.Semantic showsPrec :: Int -> TypeBinding -> ShowS # show :: TypeBinding -> String # showList :: [TypeBinding] -> ShowS # | |
Eq TypeBinding Source # | |
Defined in Language.Futhark.Semantic (==) :: TypeBinding -> TypeBinding -> Bool # (/=) :: TypeBinding -> TypeBinding -> Bool # |
Representation of a module type.