git.iko.soy/typeable/http-api-data
on master help sign in
Fix Travis builds for GHC 7
173ef33Nickolay Kudasov
src/Web/HttpApiData.hs+1
@@ -44,6 +44,7 @@ import Web.Internal.HttpApiData
44
44
45-- $setup
45-- $setup
46--
46--
47+-- >>> :unset -XOverloadedLists
47-- >>> :set -XOverloadedStrings
48-- >>> :set -XOverloadedStrings
48-- >>> import Control.Applicative
49-- >>> import Control.Applicative
49-- >>> import Data.Time
50-- >>> import Data.Time
src/Web/Internal/FormUrlEncoded.hs+3−1
@@ -14,12 +14,14 @@ module Web.Internal.FormUrlEncoded where
14
14
15#if __GLASGOW_HASKELL__ < 710
15#if __GLASGOW_HASKELL__ < 710
16import Control.Applicative
16import Control.Applicative
17+import Data.Traversable
17#endif
18#endif
18
19
19import Control.Arrow ((***))
20import Control.Arrow ((***))
20import Control.Monad ((<=<))
21import Control.Monad ((<=<))
21import qualified Data.ByteString.Lazy as BSL
22import qualified Data.ByteString.Lazy as BSL
22import qualified Data.ByteString.Lazy.Char8 as BSL8
23import qualified Data.ByteString.Lazy.Char8 as BSL8
24+import qualified Data.Foldable as F
23import Data.Hashable (Hashable)
25import Data.Hashable (Hashable)
24import Data.HashMap.Strict (HashMap)
26import Data.HashMap.Strict (HashMap)
25import qualified Data.HashMap.Strict as HashMap
27import qualified Data.HashMap.Strict as HashMap
@@ -450,7 +452,7 @@ encodeAsForm = encodeForm . toForm
450-- >>> lookupKey "name" [("name", "Oleg"), ("name", "David")]
452-- >>> lookupKey "name" [("name", "Oleg"), ("name", "David")]
451-- ["Oleg","David"]
453-- ["Oleg","David"]
452lookupKey :: Text -> Form -> [Text]
454lookupKey :: Text -> Form -> [Text]
453−lookupKey key = concat . HashMap.lookup key . unForm
455+lookupKey key = F.concat . HashMap.lookup key . unForm
454
456
455-- | Lookup a unique value for a key.
457-- | Lookup a unique value for a key.
456-- Fail if there is zero or more than one value.
458-- Fail if there is zero or more than one value.
test/Web/Internal/FormUrlEncodedSpec.hs+1
@@ -5,6 +5,7 @@ module Web.Internal.FormUrlEncodedSpec (spec) where
5
5
6#if __GLASGOW_HASKELL__ < 710
6#if __GLASGOW_HASKELL__ < 710
7import Control.Applicative
7import Control.Applicative
8+import Data.Monoid
8#endif
9#endif
9
10
10import Control.Monad ((<=<))
11import Control.Monad ((<=<))