http-pony-0.1.0.7: src/Network/HTTP/Pony/Helper.hs
-- | Helper
module Network.HTTP.Pony.Helper where
import Control.Monad.IO.Class (MonadIO(..))
import Network.Socket (Socket, ShutdownCmd(..), shutdown, isConnected)
import Control.Monad (when)
import Prelude hiding ((-))
infixr 0 -
f - x = f x
shutdownSend :: (MonadIO m) => Socket -> m ()
shutdownSend s = liftIO - do
connected <- isConnected s
when connected - do
shutdown s ShutdownSend
shutdownReceive :: (MonadIO m) => Socket -> m ()
shutdownReceive s = liftIO - do
connected <- isConnected s
when connected - do
shutdown s ShutdownReceive