diff --git a/Network/Socket/Info.hsc b/Network/Socket/Info.hsc index b262182c..6b92ebb4 100644 --- a/Network/Socket/Info.hsc +++ b/Network/Socket/Info.hsc @@ -20,15 +20,6 @@ import Network.Socket.Internal import Network.Socket.Syscall (socket) import Network.Socket.Types ------------------------------------------------------------------------------ - --- | Either a host name e.g., @\"haskell.org\"@ or a numeric host --- address string consisting of a dotted decimal IPv4 address or an --- IPv6 address e.g., @\"192.168.0.1\"@. -type HostName = String --- | Either a service name e.g., @\"http\"@ or a numeric port number. -type ServiceName = String - ----------------------------------------------------------------------------- -- Address and service lookups diff --git a/Network/Socket/Types.hsc b/Network/Socket/Types.hsc index 6ea7db5e..26afe0da 100644 --- a/Network/Socket/Types.hsc +++ b/Network/Socket/Types.hsc @@ -74,6 +74,8 @@ module Network.Socket.Types ( , defaultProtocol , PortNumber , defaultPort + , HostName + , ServiceName -- * Low-level helpers , zeroMemory @@ -291,6 +293,13 @@ type ProtocolNumber = CInt defaultProtocol :: ProtocolNumber defaultProtocol = 0 +-- | Either a host name e.g., @\"haskell.org\"@ or a numeric host +-- address string consisting of a dotted decimal IPv4 address or an +-- IPv6 address e.g., @\"192.168.0.1\"@. +type HostName = String +-- | Either a service name e.g., @\"http\"@ or a numeric port number. +type ServiceName = String + ----------------------------------------------------------------------------- -- Socket types @@ -1062,7 +1071,7 @@ type ScopeID = Word32 -- -- See also 'Network.Socket.socketFromEndpoint'. data SockEndpoint - = EndpointByName !String !PortNumber + = EndpointByName !HostName !PortNumber | EndpointByAddr !SockAddr deriving (Eq, Ord)