@@ -28,6 +28,8 @@ import System.Directory (doesDirectoryExist,
2828 doesFileExist, getDirectoryContents)
2929import Control.Applicative ((<$>))
3030
31+import Data.List (nub)
32+
3133type FunctionName = String
3234
3335run :: Port -> ModuleName -> FunctionName -> [FilePath] -> IO ()
@@ -77,12 +79,16 @@ fillApp modu func mqueue dirs =
7779 threadDelay 1000000
7880 go newError newFiles
7981 reload prevError = do
80− putStrLn "Attempting to interpret your app..."
82+ case prevError of
83+ Nothing -> putStrLn "Attempting to interpret your app..."
84+ _ -> return ()
8185 loadingApp' prevError mqueue
8286 res <- theapp modu func
8387 case res of
8488 Left err -> do
85− putStrLn $ "Compile failed: " ++ showInterpError err
89+ if show (Just err) /= show prevError
90+ then putStrLn $ "Compile failed: " ++ showInterpError err
91+ else return ()
8692 loadingApp' (Just $ toException err) mqueue
8793 return (Just $ toException err, [])
8894 Right (app, files') -> E.handle onInitErr $ do
@@ -100,7 +106,7 @@ fillApp modu func mqueue dirs =
100106
101107showInterpError :: InterpreterError -> String
102108showInterpError (WontCompile errs) =
103− concat $ map (\(GhcError msg) -> '\n':'\n':msg) errs
109+ concat . nub $ map (\(GhcError msg) -> '\n':'\n':msg) errs
104110showInterpError err = show err
105111
106112fileList :: FilePath -> IO [FilePath]