@@ -71,6 +71,22 @@ class FromHttpApiData a where
7171 parseQueryParam :: Text -> Either Text a
7272 parseQueryParam = parseUrlPiece
7373
74+-- | Convert multiple values to a list of URL pieces.
75+--
76+-- >>> toUrlPieces [1, 2, 3]
77+-- ["1","2","3"]
78+toUrlPieces :: (Functor t, ToHttpApiData a) => t a -> t Text
79+toUrlPieces = fmap toUrlPiece
80+
81+-- | Parse multiple URL pieces.
82+--
83+-- >>> parseUrlPieces ["true", "false"] :: Either Text [Bool]
84+-- Right [True,False]
85+-- >>> parseUrlPieces ["123", "hello", "world"] :: Either Text [Int]
86+-- Left "input does not start with a digit"
87+parseUrlPieces :: (Traversable t, FromHttpApiData a) => t Text -> Either Text (t a)
88+parseUrlPieces = traverse parseUrlPiece
89+
7490-- | Parse URL path piece in a @'Maybe'@.
7591--
7692-- >>> parseUrlPieceMaybe "12" :: Maybe Int