packages feed

wai-handler-devel 0.1.0.1 → 0.1.1

raw patch · 2 files changed

+14/−3 lines, 2 files

Files

Network/Wai/Handler/DevelServer.hs view
@@ -28,6 +28,8 @@                          doesFileExist, getDirectoryContents) import Control.Applicative ((<$>)) +import Data.List (nub)+ type FunctionName = String  run :: Port -> ModuleName -> FunctionName -> [FilePath] -> IO ()@@ -77,12 +79,16 @@         threadDelay 1000000         go newError newFiles     reload prevError = do-        putStrLn "Attempting to interpret your app..."+        case prevError of+             Nothing -> putStrLn "Attempting to interpret your app..."+             _       -> return ()         loadingApp' prevError mqueue         res <- theapp modu func         case res of             Left err -> do-                putStrLn $ "Compile failed: " ++ show err+                if show (Just err) /= show prevError+                   then putStrLn $ "Compile failed: " ++ showInterpError err+                   else return ()                 loadingApp' (Just $ toException err) mqueue                 return (Just $ toException err, [])             Right (app, files') -> E.handle onInitErr $ do@@ -97,6 +103,11 @@         putStrLn $ "Error initializing application: " ++ show e         loadingApp' (Just e) mqueue         return (Just e, [])++showInterpError :: InterpreterError -> String+showInterpError (WontCompile errs) =+    concat . nub $ map (\(GhcError msg) -> '\n':'\n':msg) errs+showInterpError err = show err  fileList :: FilePath -> IO [FilePath] fileList top = do
wai-handler-devel.cabal view
@@ -1,5 +1,5 @@ Name:                wai-handler-devel-Version:             0.1.0.1+Version:             0.1.1 Synopsis:            WAI server that automatically reloads code after modification. Description:         This handler automatically reloads your source code upon any changes. It works by using the hint package, essentially embedding GHC inside the handler. The handler (both the executable and library) takes three arguments: the port to listen on, the module name containing the application function, and the name of the function.                      .