@@ -1,5 +1,6 @@
11{-# LANGUAGE Rank2Types #-}
22{-# LANGUAGE ExistentialQuantification #-}
3+{-# LANGUAGE DeriveDataTypeable #-}
34{-|
45
56This module defines a generic web application interface. It is a common
@@ -74,6 +75,7 @@ import qualified Data.ByteString.Char8 as B8
7475import qualified Data.ByteString.Lazy as L
7576import Data.Char (toLower)
7677import Data.String (IsString (..))
78+import Data.Typeable (Typeable)
7779
7880-- | HTTP request method. Since the HTTP protocol allows arbitrary request
7981-- methods, we leave this open as a 'B.ByteString'. Please note the request
@@ -257,6 +259,7 @@ data Request = Request
257259 -- | The client\'s host information.
258260 , remoteHost :: B.ByteString
259261 }
262+ deriving Typeable
260263
261264-- | The response body returned to the server from the application. We provide
262265-- three separate constructors as optimizations:
@@ -274,6 +277,7 @@ data Request = Request
274277data ResponseBody = ResponseFile FilePath
275278 | ResponseEnumerator Enumerator
276279 | ResponseLBS L.ByteString
280+ deriving Typeable
277281
278282data Response = Response
279283 { status :: Status
@@ -284,6 +288,7 @@ data Response = Response
284288 -- whatever means it wishes. If 'Right', it will call the 'Enumerator'.
285289 , responseBody :: ResponseBody
286290 }
291+ deriving Typeable
287292
288293type Application = Request -> IO Response
289294