| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Futhark.TypeChecker
Description
The type checker checks whether the program is type-consistent and adds type annotations and various other elaborations. The program does not need to have any particular properties for the type checker to function; in particular it does not need unique names.
Synopsis
- checkProg :: Imports -> VNameSource -> ImportName -> UncheckedProg -> Either TypeError (FileModule, Warnings, VNameSource)
- checkExp :: Imports -> VNameSource -> Env -> UncheckedExp -> Either TypeError Exp
- checkDec :: Imports -> VNameSource -> Env -> ImportName -> UncheckedDec -> Either TypeError (Env, Dec, VNameSource)
- data TypeError
- data Warnings
- initialEnv :: Env
Documentation
checkProg :: Imports -> VNameSource -> ImportName -> UncheckedProg -> Either TypeError (FileModule, Warnings, VNameSource) Source #
Type check a program containing no type information, yielding
either a type error or a program with complete type information.
Accepts a mapping from file names (excluding extension) to
previously type checker results. The FilePath is used to resolve
relative imports.
checkExp :: Imports -> VNameSource -> Env -> UncheckedExp -> Either TypeError Exp Source #
Type check a single expression containing no type information,
yielding either a type error or the same expression annotated with
type information. See also checkProg.
checkDec :: Imports -> VNameSource -> Env -> ImportName -> UncheckedDec -> Either TypeError (Env, Dec, VNameSource) Source #
Type check a single declaration containing no type information,
yielding either a type error or the same expression annotated with
type information along the Env produced by that declaration. See
also checkProg.
Information about an error during type checking. The Show
instance for this type produces a human-readable description.
Instances
| Show TypeError Source # | |
| MonadError TypeError TypeM Source # | |
Defined in Language.Futhark.TypeChecker.Monad Methods throwError :: TypeError -> TypeM a # catchError :: TypeM a -> (TypeError -> TypeM a) -> TypeM a # | |
The warnings produced by the compiler. The Show instance
produces a human-readable description.
initialEnv :: Env Source #
An initial environment for the type checker, containing intrinsics and such.