packages feed

hack2 2011.6.20 → 2012.1.19

raw patch · 3 files changed

+10/−20 lines, 3 filesdep −enumeratordep ~basePVP ok

version bump matches the API change (PVP)

Dependencies removed: enumerator

Dependency ranges changed: base

API changes (from Hackage documentation)

- Hack2: HackEnumerator :: (forall a. Enumerator ByteString IO a) -> HackEnumerator
- Hack2: instance Default HackEnumerator
- Hack2: instance Show HackEnumerator
- Hack2: newtype HackEnumerator
- Hack2: unHackEnumerator :: HackEnumerator -> (forall a. Enumerator ByteString IO a)
- Hack2: Env :: RequestMethod -> ByteString -> ByteString -> ByteString -> ByteString -> Int -> [(ByteString, ByteString)] -> (Int, Int, Int) -> HackUrlScheme -> HackEnumerator -> HackErrors -> [(ByteString, ByteString)] -> Env
+ Hack2: Env :: RequestMethod -> ByteString -> ByteString -> ByteString -> ByteString -> Int -> [(ByteString, ByteString)] -> (Int, Int, Int) -> HackUrlScheme -> ByteString -> HackErrors -> [(ByteString, ByteString)] -> Env
- Hack2: Response :: Int -> [(ByteString, ByteString)] -> HackEnumerator -> Response
+ Hack2: Response :: Int -> [(ByteString, ByteString)] -> ByteString -> Response
- Hack2: body :: Response -> HackEnumerator
+ Hack2: body :: Response -> ByteString
- Hack2: hackInput :: Env -> HackEnumerator
+ Hack2: hackInput :: Env -> ByteString

Files

hack2.cabal view
@@ -1,5 +1,5 @@ Name:                 hack2-Version:              2011.6.20+Version:              2012.1.19 Build-type:           Simple Synopsis:             a Haskell Webserver Interface (V2) Description:@@ -18,7 +18,7 @@  library   ghc-options: -Wall-  build-depends: base >= 3 && < 5, data-default >= 0.2, bytestring, enumerator < 5+  build-depends: base >= 3 && < 99, data-default >= 0.2, bytestring   hs-source-dirs: src/   exposed-modules:                       Hack2
readme.md view
@@ -29,7 +29,7 @@      import Hack2     import Hack2.Contrib.Response (set_body_bytestring)-    import Hack2.Handler.HappstackServer+    import Hack2.Handler.SnapServer     import Data.Default (def)      app :: Application@@ -89,7 +89,7 @@  ### pick a backend -    cabal install hack2-handler-happstack-server+    cabal install hack2-handler-snap-server  ### Create a Hack app @@ -99,7 +99,7 @@      import Hack2     import Hack2.Contrib.Response (set_body_bytestring)-    import Hack2.Handler.HappstackServer+    import Hack2.Handler.SnapServer     import Data.Default (def)      app :: Application@@ -128,7 +128,7 @@      import Hack2     import Hack2.Contrib.Response (set_body_bytestring)-    import Hack2.Handler.HappstackServer+    import Hack2.Handler.SnapServer     import Data.Default (def)      import Data.ByteString.Lazy.Char8 (pack)
src/Hack2.hs view
@@ -8,10 +8,7 @@  import Data.ByteString (ByteString) import qualified Data.ByteString as B-import qualified Data.ByteString as Strict -import Data.Enumerator (Enumerator, enumEOF)- type Application = Env -> IO Response type Middleware  = Application -> Application @@ -36,14 +33,7 @@ instance Default HackErrors where   def = HackErrors (B.hPutStr stderr) -newtype HackEnumerator = HackEnumerator { unHackEnumerator :: (forall a. Enumerator Strict.ByteString IO a) } -instance Show HackEnumerator where-  show _ = "HackEnumerator"--instance Default HackEnumerator where-  def = HackEnumerator enumEOF- data Env = Env    {  requestMethod  :: RequestMethod   ,  scriptName     :: ByteString@@ -54,7 +44,7 @@   ,  httpHeaders    :: [(ByteString, ByteString)]   ,  hackVersion    :: (Int, Int, Int)   ,  hackUrlScheme  :: HackUrlScheme-  ,  hackInput      :: HackEnumerator+  ,  hackInput      :: ByteString   ,  hackErrors     :: HackErrors   ,  hackHeaders    :: [(ByteString, ByteString)]   }@@ -63,7 +53,7 @@ data Response = Response   {  status   :: Int   ,  headers  :: [(ByteString, ByteString)]-  ,  body     :: HackEnumerator+  ,  body     :: ByteString   }   deriving (Show) @@ -78,7 +68,7 @@     {       status  = 200     , headers = []-    , body    = def+    , body    = B.empty     }  instance Default Env where@@ -93,7 +83,7 @@       , httpHeaders   = def       , hackVersion   = currentVersion       , hackUrlScheme = def-      , hackInput     = def+      , hackInput     = B.empty       , hackErrors    = def       , hackHeaders   = def     }