Web Servers lesson 13
Web course is complete!
The thirteenth and final lesson of the Web Servers courseIn case you haven’t been following along: Web servers, at a low level is a 13-part course that explains the HTTP protocol and covers a variety of intermediate Haskell topics while we build a server from nearly scratch. is out today! The HTTP server that we’ve been developing throughout this course is a great application for a streaming library, so in this lesson we take the opportunity to introduce pipes
.
We hadn’t written anything about streaming yet because it is difficult to explain purpose of a streaming library, in the abstract, without grounding in some motivating example. The subject of this course serves as a perfect motivating example, and the server comes together very nicely using only a handful of basic pipe operations.
Featured: null
Our latest featured function is null
. Since Haskell doesn’t have “null” as part of the type system like some languages, we’re free to use it as the name of an ordinary function, and the Prelude
module does: It tests whether a list is empty. Many other libraries have followed suit, and “null” has become the conventional name in Haskell for any function that tests the emptiness of some kind of collection.