Skip to content

Commit

Permalink
Get rid of type signatures in export lists
Browse files Browse the repository at this point in the history
Don't duplication information for every function definition.  Haddock
documentation provides a better overview anyway.
  • Loading branch information
tibbe committed Dec 10, 2010
1 parent 03f1a2b commit e054e90
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 112 deletions.
18 changes: 9 additions & 9 deletions Network.hs
Expand Up @@ -27,26 +27,26 @@ module Network (
Socket,
PortID(..),
HostName,
PortNumber, -- instance (Eq, Enum, Num, Real, Integral)
PortNumber,

-- * Initialisation
withSocketsDo, -- :: IO a -> IO a
withSocketsDo,

-- * Server-side connections
listenOn, -- :: PortID -> IO Socket
accept, -- :: Socket -> IO (Handle, HostName, PortNumber)
sClose, -- :: Socket -> IO ()
listenOn,
accept,
sClose,

-- * Client-side connections
connectTo, -- :: HostName -> PortID -> IO Handle
connectTo,

-- * Simple sending and receiving
{-$sendrecv-}
sendTo, -- :: HostName -> PortID -> String -> IO ()
recvFrom, -- :: HostName -> PortID -> IO String
sendTo,
recvFrom,

-- * Miscellaneous
socketPort, -- :: Socket -> IO PortID
socketPort,

-- * Networking Issues
-- ** Buffering
Expand Down
58 changes: 29 additions & 29 deletions Network/BSD.hsc
Expand Up @@ -22,51 +22,51 @@
module Network.BSD (
-- * Host names
HostName,
getHostName, -- :: IO HostName
getHostName,

HostEntry(..),
getHostByName, -- :: HostName -> IO HostEntry
getHostByAddr, -- :: HostAddress -> Family -> IO HostEntry
hostAddress, -- :: HostEntry -> HostAddress
getHostByName,
getHostByAddr,
hostAddress,

#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
getHostEntries, -- :: Bool -> IO [HostEntry]
getHostEntries,
-- ** Low level functionality
setHostEntry, -- :: Bool -> IO ()
getHostEntry, -- :: IO HostEntry
endHostEntry, -- :: IO ()
setHostEntry,
getHostEntry,
endHostEntry,
#endif

-- * Service names
ServiceEntry(..),
ServiceName,
getServiceByName, -- :: ServiceName -> ProtocolName -> IO ServiceEntry
getServiceByPort, -- :: PortNumber -> ProtocolName -> IO ServiceEntry
getServicePortNumber, -- :: ServiceName -> IO PortNumber
getServiceByName,
getServiceByPort,
getServicePortNumber,

#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
getServiceEntries, -- :: Bool -> IO [ServiceEntry]
getServiceEntries,
-- ** Low level functionality
getServiceEntry, -- :: IO ServiceEntry
setServiceEntry, -- :: Bool -> IO ()
endServiceEntry, -- :: IO ()
getServiceEntry,
setServiceEntry,
endServiceEntry,
#endif

-- * Protocol names
ProtocolName,
ProtocolNumber,
ProtocolEntry(..),
getProtocolByName, -- :: ProtocolName -> IO ProtocolEntry
getProtocolByNumber, -- :: ProtocolNumber -> IO ProtcolEntry
getProtocolNumber, -- :: ProtocolName -> ProtocolNumber
defaultProtocol, -- :: ProtocolNumber
getProtocolByName,
getProtocolByNumber,
getProtocolNumber,
defaultProtocol,

#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
getProtocolEntries, -- :: Bool -> IO [ProtocolEntry]
getProtocolEntries,
-- ** Low level functionality
setProtocolEntry, -- :: Bool -> IO ()
getProtocolEntry, -- :: IO ProtocolEntry
endProtocolEntry, -- :: IO ()
setProtocolEntry,
getProtocolEntry,
endProtocolEntry,
#endif

-- * Port numbers
Expand All @@ -78,13 +78,13 @@ module Network.BSD (
NetworkEntry(..)

#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
, getNetworkByName -- :: NetworkName -> IO NetworkEntry
, getNetworkByAddr -- :: NetworkAddr -> Family -> IO NetworkEntry
, getNetworkEntries -- :: Bool -> IO [NetworkEntry]
, getNetworkByName
, getNetworkByAddr
, getNetworkEntries
-- ** Low level functionality
, setNetworkEntry -- :: Bool -> IO ()
, getNetworkEntry -- :: IO NetworkEntry
, endNetworkEntry -- :: IO ()
, setNetworkEntry
, getNetworkEntry
, endNetworkEntry
#endif
) where

Expand Down
102 changes: 49 additions & 53 deletions Network/Socket.hsc
Expand Up @@ -28,7 +28,7 @@

module Network.Socket (
-- * Types
Socket(..), -- instance Eq, Show
Socket(..),
Family(..),
SocketType(..),
SockAddr(..),
Expand All @@ -41,7 +41,7 @@ module Network.Socket (
#endif
ShutdownCmd(..),
ProtocolNumber,
defaultProtocol, -- :: ProtocolNumber
defaultProtocol,
PortNumber(..),
-- PortNumber is used non-abstractly in Network.BSD. ToDo: remove
-- this use and make the type abstract.
Expand All @@ -55,103 +55,99 @@ module Network.Socket (
AddrInfo(..),

AddrInfoFlag(..),
addrInfoFlagImplemented,-- :: AddrInfoFlag -> Bool
addrInfoFlagImplemented,

defaultHints, -- :: AddrInfo
defaultHints,

getAddrInfo, -- :: Maybe AddrInfo -> Maybe HostName -> Maybe ServiceName -> IO [AddrInfo]
getAddrInfo,

NameInfoFlag(..),

getNameInfo, -- :: [NameInfoFlag] -> Bool -> Bool -> SockAddr -> IO (Maybe HostName, Maybe ServiceName)
getNameInfo,
#endif

-- * Socket operations
socket, -- :: Family -> SocketType -> ProtocolNumber -> IO Socket
socket,
#if defined(DOMAIN_SOCKET_SUPPORT)
socketPair, -- :: Family -> SocketType -> ProtocolNumber -> IO (Socket, Socket)
socketPair,
#endif
connect, -- :: Socket -> SockAddr -> IO ()
bindSocket, -- :: Socket -> SockAddr -> IO ()
listen, -- :: Socket -> Int -> IO ()
accept, -- :: Socket -> IO (Socket, SockAddr)
getPeerName, -- :: Socket -> IO SockAddr
getSocketName, -- :: Socket -> IO SockAddr
connect,
bindSocket,
listen,
accept,
getPeerName,
getSocketName,

#ifdef HAVE_STRUCT_UCRED
-- get the credentials of our domain socket peer.
getPeerCred, -- :: Socket -> IO (CUInt{-pid-}, CUInt{-uid-}, CUInt{-gid-})
getPeerCred,
#endif

socketPort, -- :: Socket -> IO PortNumber
socketPort,

socketToHandle, -- :: Socket -> IOMode -> IO Handle
socketToHandle,

-- ** Sending and receiving data
-- $sendrecv
sendTo, -- :: Socket -> String -> SockAddr -> IO Int
sendBufTo, -- :: Socket -> Ptr a -> Int -> SockAddr -> IO Int
sendTo,
sendBufTo,

recvFrom, -- :: Socket -> Int -> IO (String, Int, SockAddr)
recvBufFrom, -- :: Socket -> Ptr a -> Int -> IO (Int, SockAddr)
recvFrom,
recvBufFrom,

send, -- :: Socket -> String -> IO Int
recv, -- :: Socket -> Int -> IO String
recvLen, -- :: Socket -> Int -> IO (String, Int)
send,
recv,
recvLen,

inet_addr, -- :: String -> IO HostAddress
inet_ntoa, -- :: HostAddress -> IO String
inet_addr,
inet_ntoa,

shutdown, -- :: Socket -> ShutdownCmd -> IO ()
sClose, -- :: Socket -> IO ()
shutdown,
sClose,

-- ** Predicates on sockets
sIsConnected, -- :: Socket -> IO Bool
sIsBound, -- :: Socket -> IO Bool
sIsListening, -- :: Socket -> IO Bool
sIsReadable, -- :: Socket -> IO Bool
sIsWritable, -- :: Socket -> IO Bool
sIsConnected,
sIsBound,
sIsListening,
sIsReadable,
sIsWritable,

-- * Socket options
SocketOption(..),
getSocketOption, -- :: Socket -> SocketOption -> IO Int
setSocketOption, -- :: Socket -> SocketOption -> Int -> IO ()
getSocketOption,
setSocketOption,

-- * File descriptor transmission
#ifdef DOMAIN_SOCKET_SUPPORT
sendFd, -- :: Socket -> CInt -> IO ()
recvFd, -- :: Socket -> IO CInt
sendFd,
recvFd,

-- Note: these two will disappear shortly
sendAncillary, -- :: Socket -> Int -> Int -> Int -> Ptr a -> Int -> IO ()
recvAncillary, -- :: Socket -> Int -> Int -> IO (Int,Int,Int,Ptr a)
sendAncillary,
recvAncillary,

#endif

-- * Special constants
aNY_PORT, -- :: PortNumber
iNADDR_ANY, -- :: HostAddress
aNY_PORT,
iNADDR_ANY,
#if defined(IPV6_SOCKET_SUPPORT)
iN6ADDR_ANY, -- :: HostAddress6
iN6ADDR_ANY,
#endif
sOMAXCONN, -- :: Int
sOL_SOCKET, -- :: Int
sOMAXCONN,
sOL_SOCKET,
#ifdef SCM_RIGHTS
sCM_RIGHTS, -- :: Int
sCM_RIGHTS,
#endif
maxListenQueue, -- :: Int
maxListenQueue,

-- * Initialisation
withSocketsDo, -- :: IO a -> IO a
withSocketsDo,

-- * Very low level operations
-- in case you ever want to get at the underlying file descriptor..
fdSocket, -- :: Socket -> CInt
mkSocket, -- :: CInt -> Family
-- -> SocketType
-- -> ProtocolNumber
-- -> SocketStatus
-- -> IO Socket
fdSocket,
mkSocket,

-- * Internal

Expand Down
41 changes: 20 additions & 21 deletions Network/URI.hs
Expand Up @@ -64,10 +64,10 @@ module Network.URI
, URIAuth(..)
, nullURI
-- * Parsing
, parseURI -- :: String -> Maybe URI
, parseURIReference -- :: String -> Maybe URI
, parseRelativeReference -- :: String -> Maybe URI
, parseAbsoluteURI -- :: String -> Maybe URI
, parseURI
, parseURIReference
, parseRelativeReference
, parseAbsoluteURI
-- * Test for strings containing various kinds of URI
, isURI
, isURIReference
Expand All @@ -76,9 +76,9 @@ module Network.URI
, isIPv6address
, isIPv4address
-- * Relative URIs
, relativeTo -- :: URI -> URI -> Maybe URI
, nonStrictRelativeTo -- :: URI -> URI -> Maybe URI
, relativeFrom -- :: URI -> URI -> URI
, relativeTo
, nonStrictRelativeTo
, relativeFrom
-- * Operations on URI strings
-- | Support for putting strings into URI-friendly
-- escaped format and getting them back again.
Expand All @@ -87,23 +87,22 @@ module Network.URI
-- The URI spec [3], section 2.4, indicates that all URI components
-- should be escaped before they are assembled as a URI:
-- \"Once produced, a URI is always in its percent-encoded form\"
, uriToString -- :: URI -> ShowS
, isReserved, isUnreserved -- :: Char -> Bool
, isAllowedInURI, isUnescapedInURI -- :: Char -> Bool
, escapeURIChar -- :: (Char->Bool) -> Char -> String
, escapeURIString -- :: (Char->Bool) -> String -> String
, unEscapeString -- :: String -> String
, uriToString
, isReserved, isUnreserved
, isAllowedInURI, isUnescapedInURI
, escapeURIChar
, escapeURIString
, unEscapeString
-- * URI Normalization functions
, normalizeCase -- :: String -> String
, normalizeEscape -- :: String -> String
, normalizePathSegments -- :: String -> String
, normalizeCase
, normalizeEscape
, normalizePathSegments
-- * Deprecated functions
, parseabsoluteURI -- :: String -> Maybe URI
, escapeString -- :: String -> (Char->Bool) -> String
, reserved, unreserved -- :: Char -> Bool
, parseabsoluteURI
, escapeString
, reserved, unreserved
, scheme, authority, path, query, fragment
)
where
) where

import Text.ParserCombinators.Parsec
( GenParser(..), ParseError(..)
Expand Down

0 comments on commit e054e90

Please sign in to comment.