@@ -14,12 +14,14 @@ module Web.Internal.FormUrlEncoded where
15#if __GLASGOW_HASKELL__ < 710
15#if __GLASGOW_HASKELL__ < 710
16import Control.Applicative
16import Control.Applicative
17+import Data.Traversable
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
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.