@@ -2,7 +2,6 @@
22{-# LANGUAGE FlexibleContexts #-}
33{-# LANGUAGE OverloadedStrings #-}
44{-# LANGUAGE FlexibleInstances #-}
5−{-# LANGUAGE StandaloneDeriving #-}
65module Network.Wai.Handler.DevelServer
76 ( run
87 , runQuit
@@ -21,6 +20,7 @@ import qualified Control.Exception as E
2120import Control.Concurrent (forkIO, threadDelay)
2221
2322import Data.Maybe
23+import Control.Monad
2424import Control.Concurrent.MVar
2525
2626import System.Directory (getModificationTime)
@@ -50,8 +50,7 @@ runQuit port modu func extras = do
5050 go ev = do
5151 x <- getLine
5252 case x of
53− 'q':_ -> do
54− putStrLn "Quitting, goodbye!"
53+ 'q':_ -> putStrLn "Quitting, goodbye!"
5554 'r':_ -> do
5655 putStrLn "Forcing reinterpretation"
5756 _ <- tryPutMVar ev ()
@@ -126,9 +125,8 @@ reload modu func extras prevError ah = do
126125 res <- theapp modu func
127126 case res of
128127 Left err -> do
129− if show (Just err) /= show prevError
130− then putStrLn $ "Compile failed: " ++ showInterpError err
131− else return ()
128+ when (show (Just err) /= show prevError) $
129+ putStrLn $ "Compile failed: " ++ showInterpError err
132130 loadingApp' (Just $ toException err) ah
133131 return (Just $ toException err, [])
134132 Right (app, files') -> E.handle onInitErr $ do