git.iko.soy/typeable/http-api-data
on master help sign in
Fix GHC 7.8 builds
e9c728bNickolay Kudasov
src/Web/HttpApiData.hs+1−2
@@ -44,7 +44,6 @@ import Web.Internal.HttpApiData
44
44
45-- $setup
45-- $setup
46--
46--
47−-- >>> :unset -XOverloadedLists
48-- >>> :set -XOverloadedStrings
47-- >>> :set -XOverloadedStrings
49-- >>> import Control.Applicative
48-- >>> import Control.Applicative
50-- >>> import Data.Time
49-- >>> import Data.Time
@@ -70,7 +69,7 @@ import Web.Internal.HttpApiData
70-- "45.2"
69-- "45.2"
71-- >>> parseQueryParam "452" :: Either Text Int
70-- >>> parseQueryParam "452" :: Either Text Int
72-- Right 452
71-- Right 452
73−-- >>> toQueryParams [1..5]
72+-- >>> toQueryParams [1..5] :: [Text]
74-- ["1","2","3","4","5"]
73-- ["1","2","3","4","5"]
75-- >>> parseQueryParams ["127", "255"] :: Either Text [Int8]
74-- >>> parseQueryParams ["127", "255"] :: Either Text [Int8]
76-- Left "out of bounds: `255' (should be between -128 and 127)"
75-- 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)
45#endif
45#endif
46
46
47-- $setup
47-- $setup
48−-- >>> :unset -XOverloadedLists
49-- >>> data BasicAuthToken = BasicAuthToken Text deriving (Show)
48-- >>> data BasicAuthToken = BasicAuthToken Text deriving (Show)
50-- >>> instance FromHttpApiData BasicAuthToken where parseHeader h = BasicAuthToken <$> parseHeaderWithPrefix "Basic " h; parseQueryParam p = BasicAuthToken <$> parseQueryParam p
49-- >>> instance FromHttpApiData BasicAuthToken where parseHeader h = BasicAuthToken <$> parseHeaderWithPrefix "Basic " h; parseQueryParam p = BasicAuthToken <$> parseQueryParam p
51
50
@@ -87,7 +86,7 @@ class FromHttpApiData a where
87
86
88-- | Convert multiple values to a list of URL pieces.
87-- | Convert multiple values to a list of URL pieces.
89--
88--
90−-- >>> toUrlPieces [1, 2, 3]
89+-- >>> toUrlPieces [1, 2, 3] :: [Text]
91-- ["1","2","3"]
90-- ["1","2","3"]
92toUrlPieces :: (Functor t, ToHttpApiData a) => t a -> t Text
91toUrlPieces :: (Functor t, ToHttpApiData a) => t a -> t Text
93toUrlPieces = fmap toUrlPiece
92toUrlPieces = fmap toUrlPiece
@@ -103,7 +102,7 @@ parseUrlPieces = traverse parseUrlPiece
103
102
104-- | Convert multiple values to a list of query parameter values.
103-- | Convert multiple values to a list of query parameter values.
105--
104--
106−-- >>> toQueryParams [fromGregorian 2015 10 03, fromGregorian 2015 12 01]
105+-- >>> toQueryParams [fromGregorian 2015 10 03, fromGregorian 2015 12 01] :: [Text]
107-- ["2015-10-03","2015-12-01"]
106-- ["2015-10-03","2015-12-01"]
108toQueryParams :: (Functor t, ToHttpApiData a) => t a -> t Text
107toQueryParams :: (Functor t, ToHttpApiData a) => t a -> t Text
109toQueryParams = fmap toQueryParam
108toQueryParams = fmap toQueryParam
stack-ghc-7.8.yaml+1
@@ -9,6 +9,7 @@ flags:
9
9
10extra-deps:
10extra-deps:
11- time-locale-compat-0.1.1.3
11- time-locale-compat-0.1.1.3
12+- uri-bytestring-0.2.2.0
12# below are dependencies necessary for use-text-show=true
13# below are dependencies necessary for use-text-show=true
13- text-show-2.1.2
14- text-show-2.1.2
14- base-compat-0.9.1
15- base-compat-0.9.1