Skip to content

Commit f8c401c

Browse files
committed
using return instead of pure.
1 parent f3da242 commit f8c401c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

Network/Socket/Info.hsc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ getAddrInfo hints node service = alloc getaddrinfo
263263
-- See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html
264264
case ais of
265265
[] -> ioError $ mkIOError NoSuchThing message Nothing Nothing
266-
_ -> pure ais
266+
_ -> return ais
267267
else do
268268
err <- gai_strerror ret
269269
ioError $ ioeSetErrorString

Network/Socket/Types.hsc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,13 +1324,13 @@ instance Read SocketType where
13241324
readPrec = P.parens $ specific <++ general
13251325
where
13261326
specific = P.lexP >>= \case
1327-
P.Ident "Stream" -> pure Stream
1328-
P.Ident "Datagram" -> pure Datagram
1329-
P.Ident "Raw" -> pure Raw
1330-
P.Ident "RDM" -> pure RDM
1331-
P.Ident "SeqPacket" -> pure SeqPacket
1332-
P.Ident "NoSocketType" -> pure NoSocketType
1333-
P.Ident "Unsupported" -> pure UnsupportedSocketType
1327+
P.Ident "Stream" -> return Stream
1328+
P.Ident "Datagram" -> return Datagram
1329+
P.Ident "Raw" -> return Raw
1330+
P.Ident "RDM" -> return RDM
1331+
P.Ident "SeqPacket" -> return SeqPacket
1332+
P.Ident "NoSocketType" -> return NoSocketType
1333+
P.Ident "Unsupported" -> return UnsupportedSocketType
13341334
_ -> mzero
13351335

13361336
general = P.prec app_prec $ do
@@ -1415,10 +1415,10 @@ instance Read Family where
14151415
readPrec = P.parens $ specific <++ general
14161416
where
14171417
specific = P.lexP >>= \case
1418-
P.Ident "AF_INET" -> pure AF_INET
1419-
P.Ident "AF_INET6" -> pure AF_INET6
1420-
P.Ident "AF_UNIX" -> pure AF_UNIX
1421-
P.Ident "AF_UNSPEC" -> pure AF_UNSPEC
1418+
P.Ident "AF_INET" -> return AF_INET
1419+
P.Ident "AF_INET6" -> return AF_INET6
1420+
P.Ident "AF_UNIX" -> return AF_UNIX
1421+
P.Ident "AF_UNSPEC" -> return AF_UNSPEC
14221422
_ -> mzero
14231423

14241424
general = P.prec app_prec $ do
@@ -1441,7 +1441,7 @@ safeInt :: forall a. (Bounded a, Integral a) => P.ReadPrec a
14411441
safeInt = do
14421442
i <- P.parens unsigned <++ P.parens (P.prec app_prec negative)
14431443
if (i >= fromIntegral (minBound :: a) && i <= fromIntegral (maxBound :: a))
1444-
then pure $ fromIntegral i
1444+
then return $ fromIntegral i
14451445
else mzero
14461446
where
14471447
unsigned :: P.ReadPrec Integer

0 commit comments

Comments
 (0)