The writer monad was merely a challenge, really. Plus since the Writer monad is particularly accustomed to accumulating results over the lifetime of a computation, and given the way the blacklist filter takes arrays in both parameters (and how it matched them), I used the Writer monad. So really, I used the Writer monad because I found it practical, and in the middle I figured out a great deal and had a lot of fun. The packet sniffer right now is being worked on in another article (and it is
long, comparatively at least.)
The Blister library was going to tie into the packet sniffer, and it still might at this point. I added in support for berkeley packet filter programs to be specified (a la tcpdump,) so i figured that would be plenty robust for the beginning builds and much later versions (right now the program and article are still being worked on in juxtaposition. I've hit a bump right now so I might need to revise the tutorial and the code some, but it works really well and I'm happy with the results.) Currently I'm working on the program's argument handling and accepting options, many of which are cribbed from tcpdump's man page. So there's the possibility I may add a parameter to allow you to specify multiple regular expressions for a packet's ASCII to abide by. So that'll be fun.
If you want the code for the packet sniffer, it's on the web. Run a:
darcs get --set-scripts-executable http://anapnea.net/~thoughtpolice/hsns
Currently it handles no options other than a berkely packet filter, but it captures packets (with filter applied, so you do have flexibility in terms of what to capture) and prints them out readably in both Hex and ASCII. And only in about 70 lines of code.
The system administrator was nice enough to install darcs so I could use it to publish my code on the web (finally; nice considering it's a free shell too from apapnea.net.) If you just want the source code it's here:
http://hpaste.org/1368. There's no tarball or executable, so you'll have to pull the repo and compile (not like that's hard.) Just be sure to run the resulting executable as root.
As a self satisfying tidbit, search results for "writer monad" on google bring my article on my blog as the #2 result.
