@@ -1,3 +1,4 @@
1{-# LANGUAGE DefaultSignatures #-}
2{-# LANGUAGE DefaultSignatures #-}
2{-# LANGUAGE DeriveGeneric #-}
3{-# LANGUAGE DeriveGeneric #-}
3{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleContexts #-}
@@ -11,6 +12,10 @@
11{-# LANGUAGE TypeOperators #-}
12{-# LANGUAGE TypeOperators #-}
12module Web.HttpApiData.Internal.FormUrlEncoded where
13module Web.HttpApiData.Internal.FormUrlEncoded where
15+#if __GLASGOW_HASKELL__ < 710
16+import Control.Applicative
14import Control.Arrow (first, left, second)
19import Control.Arrow (first, left, second)
15import Control.Monad.State
20import Control.Monad.State
16import qualified Data.ByteString.Lazy as BSL
21import qualified Data.ByteString.Lazy as BSL
@@ -31,8 +36,8 @@ newtype Form = Form { unForm :: M.Map T.Text T.Text }
32instance IsList Form where
37instance IsList Form where
33 type Item Form = (T.Text, T.Text)
38 type Item Form = (T.Text, T.Text)
34− fromList = Form . fromList
39+ fromList = Form . M.fromList
35− toList = toList . unForm
40+ toList = M.toList . unForm
37-- | A type that can be converted to @application/x-www-form-urlencoded@
42-- | A type that can be converted to @application/x-www-form-urlencoded@
38class ToForm a where
43class ToForm a where