forked from axellang/axel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to
polysemy
, and rely on Stack's ghci
Speed up file processing when no macros need to be expanded
- Loading branch information
Showing
48 changed files
with
625 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,5 @@ flycheck_*.hs | |
|
||
ctags | ||
TAGS | ||
|
||
.stack-work-profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
|
||
module Main where | ||
|
||
import Axel.Eff.App (AppEffs, runApp) | ||
import Axel.Eff.Console (putStrLn) | ||
import Axel.Haskell.File (convertFileInPlace, transpileFileInPlace) | ||
import Axel.Haskell.Project (buildProject, runProject) | ||
import Axel.Haskell.Stack (axelStackageVersion) | ||
import qualified Axel.Parse.AST as AST | ||
import Axel.Parse.Args (Command(Convert, File, Project, Version), commandParser) | ||
import Axel.Sourcemap (ModuleInfo) | ||
import Control.Monad (void) | ||
import Control.Monad.Freer (Eff) | ||
import Control.Monad.Freer.State (evalState) | ||
import qualified Data.Map as Map (empty) | ||
import Options.Applicative ((<**>), execParser, helper, info, progDesc) | ||
import Prelude hiding (putStrLn) | ||
|
||
import Axel.Eff.App(AppEffs,runApp) | ||
import Axel.Eff.Console(putStrLn) | ||
import Axel.Haskell.File(convertFileInPlace,transpileFileInPlace) | ||
import Axel.Haskell.Project(buildProject,runProject) | ||
import Axel.Haskell.Stack(axelStackageVersion) | ||
import Axel.Parse.Args(Command(Convert,File,Project,Version),commandParser) | ||
import Control.Monad(void) | ||
import qualified Data.Map as Map(empty) | ||
import Options.Applicative((<**>),execParser,helper,info,progDesc) | ||
import qualified Polysemy as Sem | ||
import qualified Polysemy.State as Sem | ||
app (Convert filePath) = (void (convertFileInPlace filePath)) | ||
app (File filePath) = | ||
(void ((evalState @ModuleInfo Map.empty) (transpileFileInPlace filePath))) | ||
app (Project) = ((>>) buildProject runProject) | ||
app (Version) = (putStrLn ((<>) "Axel version " axelStackageVersion)) | ||
|
||
app :: (((->) Command) (Eff AppEffs ())) | ||
main = | ||
((>>=) | ||
(execParser | ||
(info ((<**>) commandParser helper) (progDesc "The command to run."))) | ||
(\modeCommand -> (runApp (app modeCommand)))) | ||
|
||
main :: (IO ()) | ||
app (File filePath) = (void ((Sem.evalState Map.empty) (transpileFileInPlace filePath))) | ||
app (Project ) = ((>>) buildProject runProject) | ||
app (Version ) = (putStrLn ((<>) "Axel version " axelStackageVersion)) | ||
app :: (((->) Command) (Sem.Sem AppEffs ())) | ||
main = ((>>=) (execParser (info ((<**>) commandParser helper) (progDesc "The command to run."))) (\modeCommand -> (runApp (app modeCommand)))) | ||
main :: (IO ()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
find app src test -type f | grep -e '^.*\.hs$' | grep -v 'app/Main.hs' | grep -v 'src/Axel/Parse/Args.hs' | grep -v 'src/Axel.hs' | grep -v 'src/Axel/Haskell/Macros.hs' | xargs -L 1 hindent | ||
./onHsFiles.sh hindent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
if [ "$1" == "test" ]; then | ||
ghcid --command "stack ghci axel:lib axel:test:axel-test --ghc-options='-Wno-missing-import-lists -O0'" --test "main" | ||
elif [ -z "$1" ]; then | ||
ghcid --command "stack ghci --ghc-options='-O0' axel" | ||
fi | ||
ghcid --command "stack ghci axel:lib axel:test:axel-test --ghc-options='-O0'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
find app src test -type f | grep '^.*\.hs$' | grep -v 'app/Main.hs' | grep -v 'src/Axel/Parse/Args.hs' | grep -v 'src/Axel.hs' | grep -v 'src/Axel/Haskell/Macros.hs' | xargs -L 1 hlint --color=always | grep -v 'No hints' | ||
./onHsFiles.sh "hlint --color=always | grep -v 'No hints'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
find app src test -type f | grep '^.*\.hs$' | grep -v 'app/Main.hs' | grep -v 'src/Axel/Parse/Args.hs' | grep -v 'src/Axel.hs' | grep -v 'src/Axel/Haskell/Macros.hs' | xargs -L 1 "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
stack --work-dir .stack-work-profile --profile "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.