Skip to content

Commit f48d4be

Browse files
RyanGlScottphadej
authored andcommitted
Add Semigroup Form instance
1 parent b61b152 commit f48d4be

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

http-api-data.cabal

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ library
4949
, text >= 1.1.1.3 && < 1.3
5050
, time >= 1.4.2 && < 1.9
5151
, time-locale-compat >= 0.1.1.0 && < 0.2
52-
, unordered-containers >= 0.2.5.0 && < 0.3
52+
, unordered-containers >= 0.2.6.0 && < 0.3
5353
, uri-bytestring >= 0.1.7 && < 0.4
5454
, uuid-types >= 1.0.2 && <1.1
55+
if !impl(ghc >= 8.0)
56+
build-depends: semigroups >= 0.16 && < 0.19
5557
if flag(use-text-show)
5658
cpp-options: -DUSE_TEXT_SHOW
5759
build-depends: text-show >= 2

src/Web/Internal/FormUrlEncoded.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import Data.List (intersperse, sortBy)
3939
import Data.Map (Map)
4040
import qualified Data.Map as Map
4141
import Data.Monoid
42+
import qualified Data.Semigroup as Semi
4243
import Data.Ord (comparing)
4344

4445
import Data.Text (Text)
@@ -183,7 +184,7 @@ instance FromFormKey Natural where parseFormKey = parseQueryParam
183184
--
184185
-- 'Form' can be URL-encoded with 'urlEncodeForm' and URL-decoded with 'urlDecodeForm'.
185186
newtype Form = Form { unForm :: HashMap Text [Text] }
186-
deriving (Eq, Read, Generic, Monoid)
187+
deriving (Eq, Read, Generic, Semi.Semigroup, Monoid)
187188

188189
instance Show Form where
189190
showsPrec d form = showParen (d > 10) $

0 commit comments

Comments
 (0)