git.iko.soy/typeable/http-api-data
on master help sign in
Use pure instead of return
commitd16f7033d8421600b99d976544f52510c2c7bf3f authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateSun 11 Oct 2015, 01:33 (11 years ago) parent3b9eb1c
1 file changed+4−4
Web/HttpApiData/Internal.hs+4−4
Web/HttpApiData/Internal.hs+4−4
@@ -325,13 +325,13 @@ instance (ToHttpApiData a, ToHttpApiData b) => ToHttpApiData (Either a b) where
325325-- >>> parseUrlPiece "_" :: Either Text ()
326326-- Right ()
327327instance FromHttpApiData () where
328− parseUrlPiece "_" = return ()
328+ parseUrlPiece "_" = pure ()
329329 parseUrlPiece s = defaultParseError s
330330
331331instance FromHttpApiData Char where
332332 parseUrlPiece s =
333333 case T.uncons s of
334− Just (c, s') | T.null s' -> return c
334+ Just (c, s') | T.null s' -> pure c
335335 _ -> defaultParseError s
336336
337337-- |
@@ -340,7 +340,7 @@ instance FromHttpApiData Char where
340340instance FromHttpApiData Version where
341341 parseUrlPiece s =
342342 case reverse (readP_to_S parseVersion (T.unpack s)) of
343− ((x, ""):_) -> return x
343+ ((x, ""):_) -> pure x
344344 _ -> defaultParseError s
345345
346346#if MIN_VERSION_base(4,8,0)
@@ -387,7 +387,7 @@ instance FromHttpApiData a => FromHttpApiData (Last a) where parseUrlPiece =
387387-- Right (Just 123)
388388instance FromHttpApiData a => FromHttpApiData (Maybe a) where
389389 parseUrlPiece s
390− | T.toLower (T.take 7 s) == "nothing" = return Nothing
390+ | T.toLower (T.take 7 s) == "nothing" = pure Nothing
391391 | otherwise = Just <$> parseUrlPieceWithPrefix "Just " s
392392
393393-- |