git.iko.soy/typeable/http-api-data
on master help sign in
Use Control.Arrow.left instead of mapLeft (to avoid unnecessary deps)
826eff9Nickolay Kudasov
Web/HttpApiData/Internal.hs+2−3
@@ -13,9 +13,8 @@ module Web.HttpApiData.Internal where
13import Control.Applicative
13import Control.Applicative
14import Data.Traversable (Traversable(traverse))
14import Data.Traversable (Traversable(traverse))
15#endif
15#endif
16−import Control.Arrow ((&&&))
16+import Control.Arrow ((&&&), left)
17import Control.Monad ((<=<))
17import Control.Monad ((<=<))
18−import Data.Either.Combinators (mapLeft)
19
18
20import Data.Monoid
19import Data.Monoid
21import Data.ByteString (ByteString)
20import Data.ByteString (ByteString)
@@ -75,7 +74,7 @@ class FromHttpApiData a where
75
74
76 -- | Parse HTTP header value.
75 -- | Parse HTTP header value.
77 parseHeader :: ByteString -> Either Text a
76 parseHeader :: ByteString -> Either Text a
78− parseHeader = parseUrlPiece <=< (mapLeft (T.pack . show) . decodeUtf8')
77+ parseHeader = parseUrlPiece <=< (left (T.pack . show) . decodeUtf8')
79
78
80 -- | Parse query param value.
79 -- | Parse query param value.
81 parseQueryParam :: Text -> Either Text a
80 parseQueryParam :: Text -> Either Text a
http-api-data.cabal−1
@@ -26,7 +26,6 @@ library
26 , bytestring
26 , bytestring
27 , time
27 , time
28 , time-locale-compat >=0.1.1.0 && <0.2
28 , time-locale-compat >=0.1.1.0 && <0.2
29− , either
30 if flag(use-text-show)
29 if flag(use-text-show)
31 cpp-options: -DUSE_TEXT_SHOW
30 cpp-options: -DUSE_TEXT_SHOW
32 build-depends: text-show >= 2
31 build-depends: text-show >= 2