Tag #haskell

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#.

I accidentally Neovim+Haskell development tools. Extremely fast omnicomplete, go to definition, show type, etc., directly from the GHCi process you’re (hopefully) already using.

(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.

The =\< icon for “more symbols” on the Android keyboard totally looks like a Haskell operator.

Ported Sweetroll, the engine that powers this website, from Scotty to servant. Oh, and it’s also built with stack on GHC 7.10 now.

My favorite thing about Haskell: how the type system helps with fundamental changes. I’ve changed the data structure from Maybe to lists in microformats2-types, and then changing microformats2-parser and sweetroll was a very quick and simple “see the type error – fix it” loop.

Released pcre-heavy, a #Haskell library for actually doing regexpy things like replacing and finding all matches (with pcre-light) :-)

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.