git.iko.soy/typeable/http-api-data
on master help sign in
Change convert to parse in error message
commit62ce86fcadb1262ba2ba93cb050e3340d77f3b91 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateWed 7 Oct 2015, 13:17 (11 years ago) parent09e52f8
2 files changed+4−4
Web/HttpApiData.hs+1−1 Web/HttpApiData/Internal.hs+3−3
Web/HttpApiData.hs+1−1
@@ -31,7 +31,7 @@ import Web.HttpApiData.Internal
3131-- >>> parseUrlPiece "false" :: Either Text Bool
3232-- Right False
3333-- >>> parseUrlPiece "something else" :: Either Text Bool
34−-- Left "could not convert: `something else'"
34+-- Left "could not parse: `something else'"
3535--
3636-- Numbers:
3737--
Web/HttpApiData/Internal.hs+3−3
@@ -49,7 +49,7 @@ class ToHttpApiData a where
4949 toQueryParam :: a -> Text
5050 toQueryParam = toUrlPiece
5151
52−-- | Convert value from HTTP API data.
52+-- | Parse value from HTTP API data.
5353class FromHttpApiData a where
5454 {-# MINIMAL parseUrlPiece | parseQueryParam #-}
5555 -- | Parse URL path piece.
@@ -66,7 +66,7 @@ class FromHttpApiData a where
6666
6767-- | Default parsing error.
6868defaultParseError :: Text -> Either Text a
69−defaultParseError input = Left ("could not convert: `" <> input <> "'")
69+defaultParseError input = Left ("could not parse: `" <> input <> "'")
7070
7171-- | Convert @'Maybe'@ parser into @'Either' 'Text'@ parser with default error message.
7272parseMaybeTextData :: (Text -> Maybe a) -> (Text -> Either Text a)
@@ -95,7 +95,7 @@ showTextData = T.toLower . T.pack . show
9595-- >>> parseUrlPieceWithPrefix "Just " "just 10" :: Either Text Int
9696-- Right 10
9797-- >>> parseUrlPieceWithPrefix "Left " "left" :: Either Text Bool
98−-- Left "could not convert: `left'"
98+-- Left "could not parse: `left'"
9999--
100100-- This can be used to implement @'FromHttpApiData'@ for single field constructors:
101101--