|
|
|
|
|
by alavrik
5557 days ago
|
|
The HTTP request parser doesn't look readable or trivial to me at all. I'm not familiar with Haskell, so to me the code looks like a mix of high-level declarative and low-level specialized constructs (e.g. skipWhile, takeWhile) interleaved with syntax noise. And it seems to be using quite a lot of external libraries. Also, correspondence of the code with the HTTP spec is completely non-obvious. In contrast, here's an HTTP response parser I wrote in OCaml using just one library: https://github.com/alavrik/piqi/blob/master/piqi-tools/piqi_... (see lines 26 - 218). I've just noticed that the code you are referring to is an example. Well, looking at the example, I can hardly come to a conclusion that Haskell shines for parsing. |
|
By the way, that long import list is actually just importing some basic stuff from the standard library, and the attoparsec parsing library. One of the persistent minor annoyances of Haskell is writing long lists of module imports.