File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ import Control.Concurrent.STM (
1515import Control.Exception (SomeException , try )
1616import Control.Monad (forever )
1717import Data.IORef (IORef , atomicModifyIORef' , newIORef , readIORef )
18+ import Data.Maybe (maybeToList )
1819import Data.Text (Text )
1920import qualified Data.Text as T
21+ import System.Environment (lookupEnv )
2022import System.IO (
2123 BufferMode (LineBuffering ),
2224 Handle ,
@@ -60,7 +62,11 @@ data SessionConfig = SessionConfig
6062
6163newSession :: SessionConfig -> IO Session
6264newSession cfg = do
63- let args = [" repl" , " exe:main" , " --project-dir=" ++ scProjectDir cfg, " -v0" ]
65+ mGhc <- lookupEnv " GHC"
66+ let compilerArgs = [" --with-compiler=" ++ ghc | ghc <- maybeToList mGhc]
67+ args =
68+ [" repl" , " exe:main" , " --project-dir=" ++ scProjectDir cfg, " -v0" ]
69+ ++ compilerArgs
6470 cp =
6571 (proc " cabal" args)
6672 { std_in = CreatePipe
You can’t perform that action at this time.
0 commit comments