Commit 2f11f85e authored by Andrew Gibiansky's avatar Andrew Gibiansky

Fixes for compilation errors

parent 296c75f7
...@@ -18,7 +18,7 @@ import ClassyPrelude hiding (init, last, liftIO, head, hGetContents, t ...@@ -18,7 +18,7 @@ import ClassyPrelude hiding (init, last, liftIO, head, hGetContents, t
import Control.Concurrent (forkIO, threadDelay) import Control.Concurrent (forkIO, threadDelay)
import Prelude (putChar, head, tail, last, init, (!!)) import Prelude (putChar, head, tail, last, init, (!!))
import Data.List.Utils import Data.List.Utils
import Data.List (findIndex, and, foldl1) import Data.List (findIndex, and, foldl1, nubBy)
import Data.String.Utils import Data.String.Utils
import Text.Printf import Text.Printf
import Data.Char as Char import Data.Char as Char
...@@ -559,13 +559,14 @@ evalCommand _ (Directive GetKind expr) state = wrapExecution state $ do ...@@ -559,13 +559,14 @@ evalCommand _ (Directive GetKind expr) state = wrapExecution state $ do
evalCommand _ (Directive LoadFile names) state = wrapExecution state $ do evalCommand _ (Directive LoadFile names) state = wrapExecution state $ do
write state $ "Load: " ++ names write state $ "Load: " ++ names
forM_ (words names) $ \name -> do displays <- forM (words names) $ \name -> do
let filename = if endswith ".hs" name let filename = if endswith ".hs" name
then name then name
else name ++ ".hs" else name ++ ".hs"
contents <- readFile $ fpFromString filename contents <- readFile $ fpFromString filename
modName <- intercalate "." <$> getModuleName contents modName <- intercalate "." <$> getModuleName contents
doLoadModule filename modName doLoadModule filename modName
return (ManyDisplay displays)
evalCommand publish (Directive ShellCmd ('!':cmd)) state = wrapExecution state $ evalCommand publish (Directive ShellCmd ('!':cmd)) state = wrapExecution state $
case words cmd of case words cmd of
...@@ -1019,7 +1020,9 @@ doLoadModule name modName = do ...@@ -1019,7 +1020,9 @@ doLoadModule name modName = do
-- Load the new target. -- Load the new target.
target <- guessTarget name Nothing target <- guessTarget name Nothing
oldTargets <- getTargets oldTargets <- getTargets
-- Add a target, but make sure targets are unique!
addTarget target addTarget target
getTargets >>= return . (nubBy ((==) `on` targetId)) >>= setTargets
result <- load LoadAllTargets result <- load LoadAllTargets
-- Reset the context, since loading things screws it up. -- Reset the context, since loading things screws it up.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment