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

Futhark.Compiler.Program

Description

Low-level compilation parts. Look at Futhark.Compiler for a more high-level API.

Synopsis

Documentation

readLibrary Source #

Arguments

:: (MonadError CompilerError m, MonadIO m) 
=> [Name]

Extra functions that should be marked as entry points; only applies to the immediate files, not any imports imported.

-> [FilePath]

The files to read.

-> m (Warnings, Imports, VNameSource) 

Read and type-check some Futhark files.

readUntypedLibrary :: (MonadIO m, MonadError CompilerError m) => [FilePath] -> m [(ImportName, UncheckedProg)] Source #

Read (and parse) all source files (including the builtin prelude) corresponding to a set of root files.

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

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

data FileModule Source #

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

Constructors

FileModule 

Fields

data Warnings Source #

The warnings produced by the compiler. The Show instance produces a human-readable description.

Instances

Instances details
Semigroup Warnings Source # 
Instance details

Defined in Language.Futhark.Warnings

Monoid Warnings Source # 
Instance details

Defined in Language.Futhark.Warnings

Pretty Warnings Source # 
Instance details

Defined in Language.Futhark.Warnings

Methods

ppr :: Warnings -> Doc #

pprPrec :: Int -> Warnings -> Doc #

pprList :: [Warnings] -> Doc #

data LoadedProg Source #

A loaded, type-checked program. This can be used to extract information about the program, but also to speed up subsequent reloads.

noLoadedProg :: LoadedProg Source #

A "loaded program" containing no actual files. Use this as a starting point for reloadProg

lpImports :: LoadedProg -> Imports Source #

The Imports of a LoadedProg, as expected by e.g. type checking functions.

reloadProg :: (MonadError CompilerError m, MonadIO m) => LoadedProg -> [FilePath] -> m (Warnings, LoadedProg) Source #

Load some new files, reusing as much of the previously loaded program as possible. This does not *extend* the currently loaded program the way extendProg does it, so it is always correct (if less efficient) to pass noLoadedProg.

extendProg :: (MonadError CompilerError m, MonadIO m) => LoadedProg -> [FilePath] -> m (Warnings, LoadedProg) Source #

Extend a loaded program with (possibly new) files.