Tag Archives: program

Simple socket programming with Haskell

Here is a simple program showing socket programming with Haskell, created for a University assignment. It allows half-duplex (one way at a time) communication between two (or fewer ) computers: import Network import Data.Char (toLower) import Text.Regex.Posix ((=~)) import System.IO (hGetLine,hClose,hPutStrLn,hSetBuffering,BufferMode(..),Handle,stdout)   port = 8001 — a nice port number   main = withSocketsDo $ [...]