packages feed

web-encodings 0.2.5 → 0.2.6

raw patch · 3 files changed

+24/−16 lines, 3 filesdep −safedep ~failuredep ~waiPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies removed: safe

Dependency ranges changed: failure, wai

API changes (from Hackage documentation)

- Web.Encodings: decodeUrlFailure :: (MonadFailure DecodeUrlException m, StringLike s) => s -> m s
+ Web.Encodings: decodeUrlFailure :: (Failure DecodeUrlException m, StringLike s, Monad m) => s -> m s
- Web.Encodings: decodeUrlPairsFailure :: (StringLike s, MonadFailure DecodeUrlException m) => s -> m [(s, s)]
+ Web.Encodings: decodeUrlPairsFailure :: (StringLike s, Failure DecodeUrlException m, Monad m) => s -> m [(s, s)]
- Web.Encodings.MimeHeader: lookupHeader :: (StringLike s, MonadFailure (HeaderNotFound s) m, Eq s) => s -> [Header s] -> m s
+ Web.Encodings.MimeHeader: lookupHeader :: (StringLike s, Failure (HeaderNotFound s) m, Eq s, Monad m) => s -> [Header s] -> m s
- Web.Encodings.MimeHeader: lookupHeaderAttr :: (MonadFailure (AttributeNotFound s) m, StringLike s, Eq s) => s -> s -> [Header s] -> m s
+ Web.Encodings.MimeHeader: lookupHeaderAttr :: (Failure (AttributeNotFound s) m, StringLike s, Eq s, Monad m) => s -> s -> [Header s] -> m s

Files

Web/Encodings.hs view
@@ -63,7 +63,6 @@ import Web.Encodings.StringLike (StringLike) import qualified Web.Encodings.StringLike as SL import Control.Failure-import Safe import Data.Char (ord, isControl) import Data.Function (on) import Data.Typeable (Typeable)@@ -118,7 +117,8 @@  -- | Same as 'decodeUrl', but 'failure's on either invalid percent or UTF8 -- encoding.-decodeUrlFailure :: (MonadFailure DecodeUrlException m, StringLike s)+decodeUrlFailure :: (Failure DecodeUrlException m, StringLike s,+                     Monad m)                  => s -> m s decodeUrlFailure s = do     bs <- decodeUrlFailure' s@@ -126,7 +126,8 @@         Nothing -> failure InvalidUtf8Encoding         Just x -> return x -decodeUrlFailure' :: (MonadFailure DecodeUrlException m, StringLike s)+decodeUrlFailure' :: (Failure DecodeUrlException m, StringLike s,+                      Monad m)                   => s -> m BS.ByteString decodeUrlFailure' s = do   case SL.uncons s of@@ -207,8 +208,9 @@  readDecChar :: String -> Maybe Char readDecChar s = do-    i <- readMay s :: Maybe Int-    return $ toEnum i+    case reads s of+        (i, _):_ -> Just $ toEnum (i :: Int)+        _ -> Nothing  -- | Convert into key-value pairs. Strips the leading ? if necesary. decodeUrlPairs :: StringLike s@@ -220,14 +222,16 @@  -- | Convert into key-value pairs. Strips the leading ? if necesary. 'failure's -- as necesary for invalid encodings.-decodeUrlPairsFailure :: (StringLike s, MonadFailure DecodeUrlException m)+decodeUrlPairsFailure :: (StringLike s, Failure DecodeUrlException m,+                          Monad m)                       => s                       -> m [(s, s)] decodeUrlPairsFailure = mapM decodeUrlPairFailure                       . SL.split '&'                       . SL.dropWhile (== '?') -decodeUrlPairFailure :: (StringLike s, MonadFailure DecodeUrlException m)+decodeUrlPairFailure :: (StringLike s, Failure DecodeUrlException m,+                         Monad m)                      => s                      -> m (s, s) decodeUrlPairFailure b = do@@ -321,7 +325,8 @@     partitionEithers . catMaybes . map parsePiece . getPieces boundary  -- | Parse a single segment of a multipart/form-data POST.-parsePiece :: (StringLike s, MonadFailure (AttributeNotFound s) m)+parsePiece :: (StringLike s, Failure (AttributeNotFound s) m,+               Monad m)            => s            -> m (Either (s, s) (s, FileInfo s s)) parsePiece b = do@@ -431,7 +436,9 @@      in (trimWhite s', readQ $ trimWhite q')  readQ :: StringLike s => s -> Double-readQ = Safe.readDef 1.0 . SL.unpack+readQ s = case reads $ SL.unpack s of+            (x, _):_ -> x+            _ -> 1.0  trimWhite :: StringLike s => s -> s trimWhite = SL.dropWhile (== ' ')
Web/Encodings/MimeHeader.hs view
@@ -55,8 +55,9 @@ data AttributeNotFound s = AttributeNotFound s s     deriving (Show, Typeable) instance (Typeable s, Show s) => Exception (AttributeNotFound s)-lookupHeaderAttr :: ( MonadFailure (AttributeNotFound s) m, StringLike s-                    , Eq s)+lookupHeaderAttr :: ( Failure (AttributeNotFound s) m, StringLike s+                    , Eq s+                    , Monad m)                  => s                  -> s                  -> [Header s]@@ -72,7 +73,8 @@     deriving (Typeable, Show) instance (Show s, Typeable s) => Exception (HeaderNotFound s) -lookupHeader :: (StringLike s, MonadFailure (HeaderNotFound s) m, Eq s)+lookupHeader :: (StringLike s, Failure (HeaderNotFound s) m, Eq s,+                 Monad m)              => s              -> [Header s]              -> m s
web-encodings.cabal view
@@ -1,5 +1,5 @@ name:            web-encodings-version:         0.2.5+version:         0.2.6 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -22,9 +22,8 @@                      old-locale >= 1.0.0.1 && < 1.1,                      bytestring >= 0.9.1.4 && < 0.10,                      text >= 0.5 && < 0.8,-                     failure >= 0.0.0 && < 0.1,-                     safe >= 0.2 && < 0.3,-                     wai >= 0.0.0 && < 0.3,+                     failure >= 0.0.0 && < 0.2,+                     wai >= 0.0.0 && < 0.1,                      directory >= 1 && < 1.1     exposed-modules: Web.Encodings                      Web.Encodings.MimeHeader,