git.iko.soy/typeable/http-api-data
on master help sign in
Fix GHC 7.8 builds
commite9c728be4874e64f05f21fad77e9b9a8ba963879 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateTue 30 Aug 2016, 17:15 (10 years ago) parent5a448b3
3 files changed+4−5
src/Web/HttpApiData.hs+1−2 src/Web/Internal/HttpApiData.hs+2−3 stack-ghc-7.8.yaml+1
src/Web/HttpApiData.hs+1−2
@@ -44,7 +44,6 @@ import Web.Internal.HttpApiData
4444
4545-- $setup
4646--
47−-- >>> :unset -XOverloadedLists
4847-- >>> :set -XOverloadedStrings
4948-- >>> import Control.Applicative
5049-- >>> import Data.Time
@@ -70,7 +69,7 @@ import Web.Internal.HttpApiData
7069-- "45.2"
7170-- >>> parseQueryParam "452" :: Either Text Int
7271-- Right 452
73−-- >>> toQueryParams [1..5]
72+-- >>> toQueryParams [1..5] :: [Text]
7473-- ["1","2","3","4","5"]
7574-- >>> parseQueryParams ["127", "255"] :: Either Text [Int8]
7675-- Left "out of bounds: `255' (should be between -128 and 127)"
src/Web/Internal/HttpApiData.hs+2−3
@@ -45,7 +45,6 @@ import TextShow (TextShow, showt)
4545#endif
4646
4747-- $setup
48−-- >>> :unset -XOverloadedLists
4948-- >>> data BasicAuthToken = BasicAuthToken Text deriving (Show)
5049-- >>> instance FromHttpApiData BasicAuthToken where parseHeader h = BasicAuthToken <$> parseHeaderWithPrefix "Basic " h; parseQueryParam p = BasicAuthToken <$> parseQueryParam p
5150
@@ -87,7 +86,7 @@ class FromHttpApiData a where
8786
8887-- | Convert multiple values to a list of URL pieces.
8988--
90−-- >>> toUrlPieces [1, 2, 3]
89+-- >>> toUrlPieces [1, 2, 3] :: [Text]
9190-- ["1","2","3"]
9291toUrlPieces :: (Functor t, ToHttpApiData a) => t a -> t Text
9392toUrlPieces = fmap toUrlPiece
@@ -103,7 +102,7 @@ parseUrlPieces = traverse parseUrlPiece
103102
104103-- | Convert multiple values to a list of query parameter values.
105104--
106−-- >>> toQueryParams [fromGregorian 2015 10 03, fromGregorian 2015 12 01]
105+-- >>> toQueryParams [fromGregorian 2015 10 03, fromGregorian 2015 12 01] :: [Text]
107106-- ["2015-10-03","2015-12-01"]
108107toQueryParams :: (Functor t, ToHttpApiData a) => t a -> t Text
109108toQueryParams = fmap toQueryParam
stack-ghc-7.8.yaml+1
@@ -9,6 +9,7 @@ flags:
99
1010extra-deps:
1111- time-locale-compat-0.1.1.3
12+- uri-bytestring-0.2.2.0
1213# below are dependencies necessary for use-text-show=true
1314- text-show-2.1.2
1415- base-compat-0.9.1