I’m working on a server-side HTTP cache! It’s a Haskell WAI middleware. It’s controlled by Cache-Control / Vary. It doesn’t have real storage backends yet, but it has a test that I’m really happy with and some thoughts about using caches against DoS attacks in the README.

Oh, also it’s probably a good example of OOP-ish Haskell. Thanks to GADTs, the CacheConf constructor “eats” the backend types :D It’s like class Conf { BackendInterface backend; } in Java/C#.

(This post contains Haskell.)

Landed a couple pull requests (jwt, wai-app-static) that replace the deprecated cryptohash package with cryptonite, because having both as dependencies in sweetroll was terrible.

Also, turns out highlighting-kate has a pcre-light option, so now regex-pcre-builtin isn’t compiled into sweetroll as well. I wish pandoc had a build option to disable Lua script integration. Oh, and build options to disable formats! That would be great. I don’t need docx and epub support in my website.

Webmention endpoint discovery in Haskell. Probably the best function ever written :-)

This is how I search for it in HTML.

listToMaybe $ unsafePerformIO $ runX $ htmlDoc //> hasAttrValue "rel" isWebmentionRel >>> getAttrValue "href"

Why unsafePerformIO? Because there’s no reason for HTML parsing to depend on IO, but they’ve implemented parsing strings as parsing files with the string protocol.