Safe Haskell | None |
---|
A pipeline is an abstraction of a single compiler pass.
NOTE: The Haddock documentation on pipeline constructors is missing because Haddock does not support commenting GADTs. See the source code for documentation.
- data Error
- = forall err . Pretty err => ErrorLoad !err
- | forall err . Pretty err => ErrorLint !err
- | forall err . Pretty (err (AnTEC SourcePos Name)) => ErrorSaltLoad (Error Name err)
- | forall err . Pretty err => ErrorSaltConvert !err
- | forall err . Pretty err => ErrorTetraConvert !err
- | forall err . Pretty err => ErrorLiteConvert !err
- | forall err . Pretty err => ErrorCoreTransform !err
- data PipeText n err where
- PipeTextOutput :: !Sink -> PipeText n err
- PipeTextLoadCore :: (Ord n, Show n, Pretty n, Pretty (err (AnTEC SourcePos n))) => !(Fragment n err) -> !(Mode n) -> !Sink -> ![PipeCore (AnTEC SourcePos n) n] -> PipeText n err
- PipeTextLoadSourceTetra :: !Sink -> !Sink -> !Sink -> ![PipeCore (AnTEC SourcePos Name) Name] -> PipeText n err
- pipeText :: NFData n => String -> Int -> String -> PipeText n err -> IO [Error]
- data PipeCore a n where
- PipeCoreId :: ![PipeCore a n] -> PipeCore a n
- PipeCoreOutput :: !(PrettyMode (Module a n)) -> !Sink -> PipeCore a n
- PipeCoreCheck :: (Pretty a, Pretty (err (AnTEC a n))) => !(Fragment n err) -> !(Mode n) -> !Sink -> ![PipeCore (AnTEC a n) n] -> PipeCore a n
- PipeCoreReCheck :: (NFData a, Show a, Pretty a, Pretty (err (AnTEC a n))) => !(Fragment n err) -> !(Mode n) -> ![PipeCore (AnTEC a n) n] -> PipeCore (AnTEC a n') n
- PipeCoreReannotate :: (NFData b, Show b) => (a -> b) -> ![PipeCore b n] -> PipeCore a n
- PipeCoreSimplify :: !(Fragment n err) -> !s -> !(Simplifier s a n) -> ![PipeCore () n] -> PipeCore a n
- PipeCoreAsTetra :: ![PipeTetra (AnTEC a Name)] -> PipeCore (AnTEC a Name) Name
- PipeCoreAsLite :: ![PipeLite] -> PipeCore (AnTEC () Name) Name
- PipeCoreAsFlow :: Pretty a => ![PipeFlow a] -> PipeCore a Name
- PipeCoreAsSalt :: Pretty a => ![PipeSalt a] -> PipeCore a Name
- PipeCoreHacks :: (NFData a, Show b, NFData b) => Canned (Module a n -> IO (Module b n)) -> ![PipeCore b n] -> PipeCore a n
- pipeCore :: (NFData a, Show a, NFData n, Eq n, Ord n, Show n, Pretty n) => Module a n -> PipeCore a n -> IO [Error]
- data PipeTetra a where
- pipeTetra :: Module a Name -> PipeTetra a -> IO [Error]
- data PipeLite
- = PipeLiteOutput !Sink
- | PipeLiteToSalt !Platform !Config ![PipeCore () Name]
- pipeLite :: Module (AnTEC () Name) Name -> PipeLite -> IO [Error]
- data PipeFlow a where
- PipeFlowOutput :: Sink -> PipeFlow a
- PipeFlowHacks :: (NFData a, Show b, NFData b) => Canned (Module a Name -> IO (Module b Name)) -> ![PipeFlow b] -> PipeFlow a
- PipeFlowPrep :: [PipeCore () Name] -> PipeFlow ()
- PipeFlowRate :: [PipeCore () Name] -> PipeFlow ()
- PipeFlowLower :: Config -> [PipeCore () Name] -> PipeFlow (AnTEC () Name)
- PipeFlowMelt :: [PipeCore () Name] -> PipeFlow (AnTEC () Name)
- PipeFlowWind :: [PipeCore () Name] -> PipeFlow (AnTEC () Name)
- pipeFlow :: Module a Name -> PipeFlow a -> IO [Error]
- data PipeSalt a where
- PipeSaltId :: ![PipeSalt a] -> PipeSalt a
- PipeSaltOutput :: !Sink -> PipeSalt a
- PipeSaltTransfer :: ![PipeSalt (AnTEC a Name)] -> PipeSalt (AnTEC a Name)
- PipeSaltPrint :: !Bool -> !Platform -> !Sink -> PipeSalt a
- PipeSaltToLlvm :: !Platform -> ![PipeLlvm] -> PipeSalt a
- PipeSaltCompile :: !Platform -> !Builder -> !FilePath -> !FilePath -> !(Maybe FilePath) -> !Bool -> PipeSalt a
- pipeSalt :: (Show a, Pretty a, NFData a) => Module a Name -> PipeSalt a -> IO [Error]
- data PipeLlvm
- pipeLlvm :: Module -> PipeLlvm -> IO [Error]
- data Sink
- pipeSink :: String -> Sink -> IO [Error]
Errors
forall err . Pretty err => ErrorLoad !err | Error when loading a module. Blame it on the user. |
forall err . Pretty err => ErrorLint !err | Error when type checking a transformed module. Blame it on the compiler. |
forall err . Pretty (err (AnTEC SourcePos Name)) => ErrorSaltLoad (Error Name err) | |
forall err . Pretty err => ErrorSaltConvert !err | Error converting the module to Salt to Sea. |
forall err . Pretty err => ErrorTetraConvert !err | Error converting the module from Tetra to Salt. |
forall err . Pretty err => ErrorLiteConvert !err | Error converting the module from Lite to Salt. |
forall err . Pretty err => ErrorCoreTransform !err | Error when transforming core program. |
Source code
data PipeText n err whereSource
Process program text.
PipeTextOutput :: !Sink -> PipeText n err | |
PipeTextLoadCore :: (Ord n, Show n, Pretty n, Pretty (err (AnTEC SourcePos n))) => !(Fragment n err) -> !(Mode n) -> !Sink -> ![PipeCore (AnTEC SourcePos n) n] -> PipeText n err | |
PipeTextLoadSourceTetra :: !Sink -> !Sink -> !Sink -> ![PipeCore (AnTEC SourcePos Name) Name] -> PipeText n err |
pipeText :: NFData n => String -> Int -> String -> PipeText n err -> IO [Error]Source
Process a text module.
Returns empty list on success.
Generic Core modules
Process a core module.
pipeCore :: (NFData a, Show a, NFData n, Eq n, Ord n, Show n, Pretty n) => Module a n -> PipeCore a n -> IO [Error]Source
Process a Core module.
Returns empty list on success.
Core Tetra modules
Process a Core Tetra module.
Core Lite modules
Process a Core Lite module.
PipeLiteOutput !Sink | Output the module in core language syntax. |
PipeLiteToSalt !Platform !Config ![PipeCore () Name] | Convert the module to the Core Salt Fragment. |
Core Flow modules
Process a Core Flow module.
PipeFlowOutput :: Sink -> PipeFlow a | |
PipeFlowHacks :: (NFData a, Show b, NFData b) => Canned (Module a Name -> IO (Module b Name)) -> ![PipeFlow b] -> PipeFlow a | |
PipeFlowPrep :: [PipeCore () Name] -> PipeFlow () | |
PipeFlowRate :: [PipeCore () Name] -> PipeFlow () | |
PipeFlowLower :: Config -> [PipeCore () Name] -> PipeFlow (AnTEC () Name) | |
PipeFlowMelt :: [PipeCore () Name] -> PipeFlow (AnTEC () Name) | |
PipeFlowWind :: [PipeCore () Name] -> PipeFlow (AnTEC () Name) |
Core Salt modules
Process a Core Salt module.
PipeSaltId :: ![PipeSalt a] -> PipeSalt a | |
PipeSaltOutput :: !Sink -> PipeSalt a | |
PipeSaltTransfer :: ![PipeSalt (AnTEC a Name)] -> PipeSalt (AnTEC a Name) | |
PipeSaltPrint :: !Bool -> !Platform -> !Sink -> PipeSalt a | |
PipeSaltToLlvm :: !Platform -> ![PipeLlvm] -> PipeSalt a | |
PipeSaltCompile :: !Platform -> !Builder -> !FilePath -> !FilePath -> !(Maybe FilePath) -> !Bool -> PipeSalt a |
pipeSalt :: (Show a, Pretty a, NFData a) => Module a Name -> PipeSalt a -> IO [Error]Source
Process a Core Salt module.
Returns empty list on success.
LLVM modules
Process an LLVM module.
pipeLlvm :: Module -> PipeLlvm -> IO [Error]Source
Process an LLVM module.
Returns empty list on success.
Emitting output
What to do with program text.
SinkDiscard | Drop it on the floor. |
SinkStdout | Emit it to stdout. |
SinkFile FilePath | Write it to this file. |