Skip to content

Commit

Permalink
Update Network/Socket/Info.hsc
Browse files Browse the repository at this point in the history
Co-authored-by: endgame <[email protected]>
  • Loading branch information
kazu-yamamoto and endgame authored Sep 6, 2024
1 parent e32a05e commit 34bbbfe
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Network/Socket/Info.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,15 @@ class GetAddrInfo t where
-- | Resolve a host or service name to one or more addresses.
-- The 'AddrInfo' values that this function returns contain 'SockAddr'
-- values that you can pass directly to 'connect' or
-- 'bind'. Instances for the hidden 'GetAddrInfo' class are lists and
-- 'NonEmpty' only. Use of 'NonEmpty' is recommended as getaddrinfo() never
-- returns an empty list.
-- 'bind'.
--
-- This function calls @getaddrinfo(3)@, which never successfully returns
-- with an empty list. If the query fails, 'getAddrInfo' throws an IO
-- exception.
--
-- For backwards-compatibility reasons, a hidden 'GetAddrInfo' class is used
-- to make the result polymorphic. It only has instances for @[]@ (lists)
-- and 'NonEmpty' only. Use of 'NonEmpty' is recommended.
--
-- This function is protocol independent. It can return both IPv4 and
-- IPv6 address information.
Expand All @@ -230,10 +236,6 @@ class GetAddrInfo t where
-- a hint, network addresses in the result will contain the address of
-- the loopback interface.
--
-- If the query fails, this function throws an IO exception instead of
-- returning an empty list. Otherwise, it returns a non-empty list
-- of 'AddrInfo' values.
--
-- There are several reasons why a query might result in several
-- values. For example, the queried-for host could be multihomed, or
-- the service might be available via several protocols.
Expand Down

0 comments on commit 34bbbfe

Please sign in to comment.