Hi,
I propose to append target address to exception message in connect function.
Haskell doesn't have stack trace support as good as java.
It is really hard to figure out where a problem is if an application connects to many places,
because an exception message doesn't have target domain/ip address and port.
connectLoop :: SocketAddress sa => Socket -> Ptr sa -> CInt -> IO ()
connectLoop s p_sa sz = withFdSocket s $ \fd -> loop fd
where
errLoc = "Network.Socket.connect: " ++ show s