Haskell version of calendar_renderer