@@ -207,9 +207,15 @@ class GetAddrInfo t where
207
207
-- | Resolve a host or service name to one or more addresses.
208
208
-- The 'AddrInfo' values that this function returns contain 'SockAddr'
209
209
-- values that you can pass directly to 'connect' or
210
- -- 'bind'. Instances for the hidden 'GetAddrInfo' class are lists and
211
- -- 'NonEmpty' only. Use of 'NonEmpty' is recommended as getaddrinfo() never
212
- -- returns an empty list.
210
+ -- 'bind'.
211
+ --
212
+ -- This function calls @getaddrinfo(3)@, which never successfully returns
213
+ -- with an empty list. If the query fails, 'getAddrInfo' throws an IO
214
+ -- exception.
215
+ --
216
+ -- For backwards-compatibility reasons, a hidden 'GetAddrInfo' class is used
217
+ -- to make the result polymorphic. It only has instances for @[]@ (lists)
218
+ -- and 'NonEmpty' only. Use of 'NonEmpty' is recommended.
213
219
--
214
220
-- This function is protocol independent. It can return both IPv4 and
215
221
-- IPv6 address information.
@@ -230,10 +236,6 @@ class GetAddrInfo t where
230
236
-- a hint, network addresses in the result will contain the address of
231
237
-- the loopback interface.
232
238
--
233
- -- If the query fails, this function throws an IO exception instead of
234
- -- returning an empty list. Otherwise, it returns a non-empty list
235
- -- of 'AddrInfo' values.
236
- --
237
239
-- There are several reasons why a query might result in several
238
240
-- values. For example, the queried-for host could be multihomed, or
239
241
-- the service might be available via several protocols.
0 commit comments