packages feed

wai-handler-devel 0.2.0 → 0.2.0.1

raw patch · 2 files changed

+9/−4 lines, 2 filesdep +wai-extra

Dependencies added: wai-extra

Files

Network/Wai/Handler/DevelServer.hs view
@@ -15,13 +15,14 @@ import Data.Text.Lazy (pack) import Data.Text.Lazy.Encoding (encodeUtf8) import qualified Data.ByteString.Lazy.Char8 as L8-import Control.Exception (Exception, SomeException, toException)+import Control.Exception (Exception, SomeException, toException, fromException) import qualified Control.Exception as E import Control.Concurrent (forkIO, threadDelay)  import System.Directory (getModificationTime) import qualified Network.Wai.Handler.Warp as Warp import Network.Wai.Application.Devel+import Network.Wai.Middleware.Debug (debug)  import Data.List (nub, group, sort) import System.Time (ClockTime)@@ -124,7 +125,7 @@             let files = map head $ group $ sort $ concat $ files' : files''             putStrLn "Interpreting success, new app loaded"             E.handle onInitErr $ do-                swapApp app ah+                swapApp (\f -> app $ f . debug) ah                 times <- getTimes files                 return (Nothing, zip files times)     where@@ -151,7 +152,10 @@         ) $ toMessage err   where     toMessage Nothing = "Loading code changes, please wait"-    toMessage (Just err') = charsToLBS $ "Error loading code: " ++ show err'+    toMessage (Just err') = charsToLBS $ "Error loading code: " +++        (case fromException err' of+            Just e -> showInterpError e+            Nothing -> show err')  charsToLBS :: String -> L8.ByteString charsToLBS = encodeUtf8 . pack
wai-handler-devel.cabal view
@@ -1,5 +1,5 @@ Name:                wai-handler-devel-Version:             0.2.0+Version:             0.2.0.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.                      .@@ -23,6 +23,7 @@ Library   Build-Depends:     base                  >= 4             && < 5                    , wai                   >= 0.3           && < 0.4+                   , wai-extra             >= 0.3           && < 0.4                    , warp                  >= 0.3           && < 0.4                    , directory             >= 1.0           && < 1.2                    , network               >= 2.2           && < 2.4