Today I added a list of some recently posted messages on a sidebar on the front page. This should help you find something new and interesting to link to, tweet, etc.

As usual, I had some fun with Haskell as I built this. The interesting problem was how to choose which recently posted messages to display? I don't want it to just display the 10 newest, because then an active thread could swamp the display. I wanted a nice variety of messages posted over the past few days. My solution was the following code, which probably speaks for itself.

reduce :: RecentMsgs -> RecentMsg -> RecentMsgs
reduce m n
        | have sameMessageId = nuke sameMessageId
        | have tooOld = nuke tooOld
        | have sameSubjects = nuke sameSubjects
        | have similarSubjects = nuke similarSubjects
        | have sameNewsGroups = nuke sameNewsGroups
        | have sameAuthors = nuke sameAuthors
        | S.size m == 0 = m
        | otherwise = nuke oldest
        -- let's skip the implementation details

(Special thanks to Adam Sj√łgren for making so I can link to the articles!)