Skip to content

Commit

Permalink
[WIP] Start decoupling macro expansion from Haskell (and co.)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrosso committed Jan 9, 2020
1 parent 6f223e1 commit 66402df
Show file tree
Hide file tree
Showing 2 changed files with 264 additions and 135 deletions.
24 changes: 16 additions & 8 deletions src/Axel/Haskell/File.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ import qualified Axel.Eff.Process as Effs (Process)
import qualified Axel.Eff.Resource as Effs (Resource)
import qualified Axel.Eff.Restartable as Effs (Restartable)
import Axel.Haskell.Convert (convertFile)
import Axel.Macros (handleFunctionApplication, processProgram)
import Axel.Macros
( HaskellBackendEffs
, handleFunctionApplication
, haskellBackend
, processProgram
)
import Axel.Normalize (normalizeStatement, withExprCtxt)
import Axel.Parse (parseMultiple', parseSource)
import Axel.Parse.AST (Expression(Symbol))
Expand Down Expand Up @@ -102,13 +107,16 @@ transpileSource ::
-> Sem.Sem effs SM.Output
transpileSource filePath source =
toHaskell . statementsToProgram <$>
(parseSource (Just filePath) source >>=
processProgram
@fileExpanderEffs
@funAppExpanderEffs
handleFunctionApplication
(void . transpileFileInPlace)
filePath)
Sem.runReader
haskellBackend
(parseSource (Just filePath) source >>=
processProgram
@fileExpanderEffs
@funAppExpanderEffs
@HaskellBackendEffs
handleFunctionApplication
(void . transpileFileInPlace)
filePath)

convertFileInPlace ::
(Sem.Members '[ Effs.Console, Effs.FileSystem, Sem.Error Error, Effs.FileSystem] effs)
Expand Down
Loading

0 comments on commit 66402df

Please sign in to comment.