Permalink
Browse files

Fix up some all -W -Wall warnings

  • Loading branch information...
AaronFriel committed Dec 17, 2012
1 parent 38eee73 commit be2e187a65fafc8f64808b59b7624cfd458df932
@@ -25,8 +25,6 @@ import Network.TableStorage.Auth
import Network.TableStorage.Request
import Network.TableStorage.Response
import Network.TableStorage.Atom
-import Control.Monad ( (>=>), unless )
-import Control.Monad.Error ( ErrorT(..) )
import Data.Time.Clock ( getCurrentTime )
import Data.Maybe ( fromMaybe )
import Control.Monad.Reader
@@ -19,24 +19,19 @@ import qualified Data.ByteString.UTF8 as UTF8
( toString, fromString )
import qualified Data.ByteString.Lazy.UTF8 as UTF8L ( fromString, toString )
import qualified Data.ByteString.Lazy.Char8 as Char8L ( toChunks )
-import qualified Data.ByteString.Lazy as L ( ByteString, fromChunks )
-import qualified Crypto.Classes as Crypto ( encode )
+import qualified Data.ByteString.Lazy as L ( fromChunks )
import Crypto.Hash.MD5 as MD5 (hash)
import qualified Data.Digest.Pure.SHA as SHA
( bytestringDigest, hmacSha256 )
import Network.URI
( URIAuth(URIAuth, uriPort, uriRegName, uriUserInfo), URI(..) )
-import Network.Socket.Internal (withSocketsDo)
import Network.HTTP.Conduit
import Network.HTTP.Conduit.Internal (setUri)
import Network.HTTP.Types
import Network.TableStorage.Types
import Network.TableStorage.Format ( rfc1123Date )
import Data.Monoid ((<>))
-import Debug.Trace
import Control.Monad.Reader
-import Control.Monad.Error
-import Control.Monad.IO.Class
import Control.Monad.Trans.Resource
authenticationType :: String
@@ -102,18 +97,18 @@ qualifyResource res acc =
-- an error message or the response object.
--
authenticatedRequest :: Method -> [Header] -> String -> String -> String -> TableStorage QueryResponse
-authenticatedRequest method hdrs resource canonicalizedResource body = do
+authenticatedRequest mthd hdrs resource canonicalizedResource body = do
time <- liftIO $ rfc1123Date
(TableConf acc maybeMgr maybeProxy) <- ask
let contentMD5 = (Base64C.encode . hash . UTF8.fromString) body
let atomType = "application/atom+xml" :: B.ByteString
- let auth = SharedKeyAuth { sharedKeyAuthVerb = method
+ let auth = SharedKeyAuth { sharedKeyAuthVerb = mthd
, sharedKeyAuthContentMD5 = UTF8.toString contentMD5
, sharedKeyAuthContentType = UTF8.toString atomType
, sharedKeyAuthDate = time
, sharedKeyAuthCanonicalizedResource = "/" ++ accountName acc ++ accountResourcePrefix acc ++ canonicalizedResource }
let uri = qualifyResource resource acc
- let defaultReq = def { method = method
+ let defaultReq = def { method = mthd
, requestHeaders = [ (hAuthorization, UTF8.fromString . unAuthHeader $ authHeader acc auth)
, (hContentType, atomType)
, (hContentMD5, contentMD5)
@@ -18,7 +18,7 @@ import Data.Maybe ( fromMaybe )
import Data.List ( intercalate )
import Text.XML.Light.Types ( elAttribs )
import Text.XML.Light
- ( Element(elAttribs, elContent, elName),
+ ( Element(elContent, elName),
Content(Elem),
Attr(Attr),
blank_element )
@@ -12,8 +12,6 @@ import Data.Time ( readTime )
import System.Locale ( defaultTimeLocale )
import Text.XML.Light
( Element(elName), parseXMLDoc, findChild, strContent )
-import Control.Monad ( guard )
-import Data.Maybe ( fromMaybe )
import Network.TableStorage.Atom
import Network.TableStorage.Types
import Network.TableStorage.Format
@@ -26,8 +26,14 @@ import Control.Monad.Reader
import Control.Monad.Error
import Control.Monad.Trans.Resource
+-- |
+-- Monad stack and return type of operations on azure tables
+--
type TableStorage = ErrorT TableError (ReaderT TableConf (ResourceT IO))
+-- |
+-- TableStorage configuration data
+--
data TableConf = TableConf
{ tableAccount :: Account
, httpManager :: Maybe Manager
View
@@ -21,6 +21,7 @@ description:
Pagination and projections are currently not supported.
library
+ ghc-options: -W -Wall
hs-source-dirs: src
build-depends:
base >= 4 && < 5,

0 comments on commit be2e187

Please sign in to comment.