@@ -12,9 +12,12 @@ You want a minimal example? Here it is!
1212 import Network.HTTP.Types
1313 import Network.Wai.Handler.Warp (run)
1414 import Data.ByteString.Lazy.Char8 () -- Just for an orphan instance
15+ import Control.Monad.IO.Class (liftIO)
1516
1617 app :: Application
17− app _ = return $ responseLBS
18+ app _ = do
19+ liftIO $ putStrLn "I've done some IO here"
20+ return $ responseLBS
1821 status200
1922 [("Content-Type", "text/plain")]
2023 "Hello, Web!"
@@ -91,10 +94,11 @@ For the sake of efficiency, WAI uses the [bytestring] package. We used GHCs [ov
9194
9295 import qualified Data.ByteString.Char8 as B8
9396 import qualified Data.ByteString.Lazy.Char8 as LB8
97+ import Data.CaseInsensitive (mk)
9498
9599 notFound = responseLBS
96100 status404
97− [("Content-Type", B8.pack "text/plain")]
101+ [(mk $ B8.pack "Content-Type", B8.pack "text/plain")]
98102 (LB8.pack "404 - Not Found")
99103
100104