News for hackers. Stuff that matters.
Re:How to write a simple TCP Server in Haskell by skybrian on Thursday January 27, 2011 @08:57PM (#2150475)
It's all imperative code. Would someone who really knew Haskell write it differently?
Re:How to write a simple TCP Server in Haskell by jmillikin on Thursday January 27, 2011 @10:05PM (#2150612)
Haskell works well for both declarative and imperative styles. I would make some small changes ('forever' instead of explicit recursion, less duplicate code in handlers), but it would be basically the same.
Re:How to write a simple TCP Server in Haskell by pchickey on Thursday January 27, 2011 @10:57PM (#2150735)
There are a few Haskell web frameworks out there which take advantage of advanced Haskell features. The Snap framework is based on Iteratees, a fairly recent abstraction developed for Haskell IO. The source code is readable, though you want to make sure you understand iteratees first.

https://github.com/snapframework/snap-core/tree/master/src/S... http://okmij.org/ftp/Streams.html

Re:How to write a simple TCP Server in Haskell by merijnv on Friday January 28, 2011 @03:59AM (#2151265)
Don't fix what ain't broke. The more I grok Haskell the more I believe its not only a solid functional language but also my favorite imperative language...

Based on what usage/performance you expect you could maybe take a different approach, but for a simple and general TCP server example I don't see a reason to do anything different except maybe minor style details...