git.iko.soy/typeable/http-api-data
on master help sign in
Replace uses for toUrlPiece and parseUrlPiece with toQueryParam and parseQueryParam.
commit97f200f0da54b6952d9693c8c5727e26f79b8844 author(cdep)illabout <cdep.illabout@gmail.com> dateThu 25 Aug 2016, 18:05 (10 years ago) parentacc2cd4
1 file changed+2−2
src/Web/HttpApiData/Internal/FormUrlEncoded.hs+2−2
src/Web/HttpApiData/Internal/FormUrlEncoded.hs+2−2
@@ -88,7 +88,7 @@ instance {-# OVERLAPPABLE #-} (Selector sel, GToForm f)
8888instance (ToHttpApiData f) => GToForm (K1 i f) where
8989 gToForm (K1 a) = do
9090 s <- get
91− return . Form $ M.insert (name s) (toUrlPiece a) $ mempty
91+ return . Form $ M.insert (name s) (toQueryParam a) $ mempty
9292 where name (Nothing, i) = T.pack $ show i
9393 name (Just x, _) = x
9494
@@ -127,7 +127,7 @@ instance (Selector sel, FromHttpApiData f)
127127 => GFromForm (M1 S sel (K1 i f)) where
128128 gFromForm f = case M.lookup sel (unForm f) of
129129 Nothing -> Left . T.unpack $ "Could not find key " <> sel
130− Just v -> left T.unpack $ M1 . K1 <$> parseUrlPiece v
130+ Just v -> left T.unpack $ M1 . K1 <$> parseQueryParam v
131131 where sel = T.pack $ selName (Proxy3 :: Proxy3 sel g p)
132132
133133instance (GFromForm f) => GFromForm (M1 D x f) where