git.iko.soy/typeable/http-api-data
on master help sign in
Remove forall from showBoundedTextData type signature
ecc2783Nickolay Kudasov
Web/HttpApiData/Internal.hs+3−3
@@ -190,7 +190,7 @@ parseUrlPieceWithPrefix pattern input
190-- instance FromHttpApiData MyData where
190-- instance FromHttpApiData MyData where
191-- parseUrlPiece = parseBoundedTextData
191-- parseUrlPiece = parseBoundedTextData
192-- @
192-- @
193−parseBoundedTextData :: forall a. (TextShow a, Bounded a, Enum a) => Text -> Either Text a
193+parseBoundedTextData :: (TextShow a, Bounded a, Enum a) => Text -> Either Text a
194#else
194#else
195-- | /Case insensitive/.
195-- | /Case insensitive/.
196--
196--
@@ -207,11 +207,11 @@ parseBoundedTextData :: forall a. (TextShow a, Bounded a, Enum a) => Text -> Eit
207-- >>> instance FromHttpApiData MyData where parseUrlPiece = parseBoundedTextData
207-- >>> instance FromHttpApiData MyData where parseUrlPiece = parseBoundedTextData
208-- >>> parseUrlPiece "foo" :: Either Text MyData
208-- >>> parseUrlPiece "foo" :: Either Text MyData
209-- Right Foo
209-- Right Foo
210−parseBoundedTextData :: forall a. (Show a, Bounded a, Enum a) => Text -> Either Text a
210+parseBoundedTextData :: (Show a, Bounded a, Enum a) => Text -> Either Text a
211#endif
211#endif
212parseBoundedTextData = parseMaybeTextData (flip lookup values . T.toLower)
212parseBoundedTextData = parseMaybeTextData (flip lookup values . T.toLower)
213 where
213 where
214− values = map (showTextData &&& id) [minBound..maxBound :: a]
214+ values = map (showTextData &&& id) [minBound..maxBound]
215
215
216-- | Parse URL piece using @'Read'@ instance.
216-- | Parse URL piece using @'Read'@ instance.
217--
217--