diff options
Diffstat (limited to 'src/Language/Fiddle/Compiler.hs')
-rw-r--r-- | src/Language/Fiddle/Compiler.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Language/Fiddle/Compiler.hs b/src/Language/Fiddle/Compiler.hs index 24c7da0..a7b07ea 100644 --- a/src/Language/Fiddle/Compiler.hs +++ b/src/Language/Fiddle/Compiler.hs @@ -101,6 +101,24 @@ fromMayberOrFail sourceSpan err Nothing = do compilationFailure fromMayberOrFail _ _ (Just a) = return a +pureCompilationPhase :: + (CompilationStage stageFrom) => + ( FiddleUnit + stageFrom + (StageFunctor stageFrom) + (StageAnnotation stageFrom) -> + Compile + () + ( FiddleUnit + stageTo + (StageFunctor stageTo) + (StageAnnotation stageTo) + ) + ) -> + CompilationPhase stageFrom stageTo +pureCompilationPhase fn = + CompilationPhase (pure ()) (\_ _ -> return ([], Just ())) (\_ _ -> fn) + -- data IOActionExtraData = IOActionExtraData -- { parseFile :: FilePath -> IO (TreeType FiddleUnit Parsed), -- stage3Compile :: TreeType FiddleUnit Parsed -> |