@@ -2,7 +2,6 @@
2{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE OverloadedStrings #-}
4{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FlexibleInstances #-}
5−{-# LANGUAGE StandaloneDeriving #-}
6module Network.Wai.Handler.DevelServer
5module Network.Wai.Handler.DevelServer
@@ -21,6 +20,7 @@ import qualified Control.Exception as E
21import Control.Concurrent (forkIO, threadDelay)
20import Control.Concurrent (forkIO, threadDelay)
23import Data.Maybe
22import Data.Maybe
24import Control.Concurrent.MVar
24import Control.Concurrent.MVar
26import System.Directory (getModificationTime)
26import System.Directory (getModificationTime)
@@ -50,8 +50,7 @@ runQuit port modu func extras = do
50 go ev = do
50 go ev = do
51 x <- getLine
51 x <- getLine
54− putStrLn "Quitting, goodbye!"
53+ 'q':_ -> putStrLn "Quitting, goodbye!"
55 'r':_ -> do
54 'r':_ -> do
56 putStrLn "Forcing reinterpretation"
55 putStrLn "Forcing reinterpretation"
57 _ <- tryPutMVar ev ()
56 _ <- tryPutMVar ev ()
@@ -126,9 +125,8 @@ reload modu func extras prevError ah = do
126 res <- theapp modu func
125 res <- theapp modu func
127 case res of
126 case res of
128 Left err -> do
127 Left err -> do
129− if show (Just err) /= show prevError
128+ when (show (Just err) /= show prevError) $
130− then putStrLn $ "Compile failed: " ++ showInterpError err
129+ putStrLn $ "Compile failed: " ++ showInterpError err
132 loadingApp' (Just $ toException err) ah
130 loadingApp' (Just $ toException err) ah
133 return (Just $ toException err, [])
131 return (Just $ toException err, [])
134 Right (app, files') -> E.handle onInitErr $ do
132 Right (app, files') -> E.handle onInitErr $ do