packages feed

http-wget 0.2.0 → 0.2.1

raw patch · 2 files changed

+9/−7 lines, 2 filesdep +control-monad-failuredep −attemptPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: control-monad-failure

Dependencies removed: attempt

API changes (from Hackage documentation)

- Network.HTTP.Wget: instance Exception WgetError
- Network.HTTP.Wget: instance Show WgetError
- Network.HTTP.Wget: instance Typeable WgetError
+ Network.HTTP.Wget: WgetException :: String -> WgetException
+ Network.HTTP.Wget: instance Exception WgetException
+ Network.HTTP.Wget: instance Show WgetException
+ Network.HTTP.Wget: instance Typeable WgetException
+ Network.HTTP.Wget: newtype WgetException
- Network.HTTP.Wget: wget :: (MonadIO m, MonadAttempt m) => String -> [(String, String)] -> [(String, String)] -> m String
+ Network.HTTP.Wget: wget :: (MonadIO m, MonadFailure WgetException m) => String -> [(String, String)] -> [(String, String)] -> m String

Files

Network/HTTP/Wget.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE FlexibleContexts #-} --------------------------------------------------------- -- | -- Module        : Network.HTTP.Wget@@ -14,6 +15,7 @@ --------------------------------------------------------- module Network.HTTP.Wget     ( wget+    , WgetException (..)     ) where  import System.Process@@ -22,16 +24,16 @@ import Numeric (showHex) import Data.List (intercalate) import Control.Monad.Trans-import Control.Monad.Attempt.Class+import Control.Monad.Failure import Control.Exception import Data.Generics -newtype WgetError = WgetError String+newtype WgetException = WgetException String     deriving (Show, Typeable)-instance Exception WgetError+instance Exception WgetException  -- | Get a response from the given URL with the given parameters.-wget :: (MonadIO m, MonadAttempt m)+wget :: (MonadIO m, MonadFailure WgetException m)      => String -- ^ The URL.      -> [(String, String)] -- ^ Get parameters.      -> [(String, String)] -- ^ Post parameters. If empty, this will be a get request.@@ -52,7 +54,7 @@     exitCode <- liftIO $ waitForProcess phandle     case exitCode of         ExitSuccess -> liftIO $ hGetContents hout-        _ -> liftIO (hGetContents herr) >>= failure . WgetError+        _ -> liftIO (hGetContents herr) >>= failure . WgetException  urlEncodePairs :: [(String, String)] -> String urlEncodePairs = intercalate "&" . map urlEncodePair
http-wget.cabal view
@@ -1,5 +1,5 @@ name:            http-wget-version:         0.2.0+version:         0.2.1 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -19,7 +19,7 @@ library     build-depends:   base >= 4 && < 5,                      process,-                     attempt,+                     control-monad-failure >= 0.4,                      transformers >= 0.1.4.0,                      syb     exposed-modules: Network.HTTP.Wget