Use network sockets together with the Haskell pipes library.
Haskell
Latest commit 0c0b65e Jan 13, 2017 @alanz alanz committed with Bump upper bound on pipes. (#35)

README.md

pipes-network

Utilities to deal with sockets using the pipes and pipes-safe libraries.

Check the source or rendered Haddocks for extensive documentation.

This code is licensed under the terms of the so called 3-clause BSD license. Read the file named LICENSE found in this same directory for details.

See the PEOPLE file to learn about the people involved in this effort.