Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Web/Internal/FormUrlEncoded.hs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ class ToForm a where

instance ToForm Form where toForm = id

instance ToForm Void where toForm _ = Form HashMap.empty

instance ToForm () where toForm _ = Form HashMap.empty

instance (ToFormKey k, ToHttpApiData v) => ToForm [(k, v)] where
toForm = fromList . map (toFormKey *** toQueryParam)

Expand Down Expand Up @@ -413,6 +417,8 @@ class FromForm a where

instance FromForm Form where fromForm = pure

instance FromForm () where fromForm _ = Right ()

-- | _NOTE:_ this conversion is unstable and may result in different key order (but not values).
instance (FromFormKey k, FromHttpApiData v) => FromForm [(k, v)] where
fromForm = fmap (concatMap (\(k, vs) -> map ((,) k) vs)) . toEntriesByKey
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-12.10
resolver: lts-23.3
packages:
- '.'
flags:
Expand Down