# \[ANN\] Today is Doomsday! (0.1)

**URL:** <https://discourse.haskell.org/t/ann-today-is-doomsday-0-1/14061>\
**Category:** Announcements\
**Created:** [May 9, 2026, 1:16am UTC](https://discourse.haskell.org/t/ann-today-is-doomsday-0-1/14061 "2026-05-09T01:16:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xsebek](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/xsebek/32/2463_2.png) [@xsebek](https://discourse.haskell.org/u/xsebek)\
**Post date:** [May 9, 2026, 1:16am UTC](https://discourse.haskell.org/t/ann-today-is-doomsday-0-1/14061/1 "2026-05-09T01:16:18Z")

</div>

Hi everyone,

I wanted to share a small command line program I made to train calculating day of the week:

> **[GitHub - xsebek/doomsday-hs: Algorithm for computing day of the week mentally.](https://github.com/xsebek/doomsday-hs)**
>
> Algorithm for computing day of the week mentally.

It is based on [Conway’s Doomsday algorithm](https://en.wikipedia.org/wiki/Doomsday_rule), to mentally calculate year “anchor” (this year it’s Saturday) and then use mnemonics for each month’s “doomsday” (select Saturdays from which to count).

Like today “working 9-to-5”, which also works for September 5th:

 ![Screenshot 2026-05-09 at 1.39.49 AM](https://us1.discourse-cdn.com/flex002/uploads/haskell/original/2X/8/824550719095135a35b65980ab3facf9c2fb1531.jpeg)  
It has a REPL made with Haskeline and can show statistics using Granite:

 ![Screenshot 2026-05-08 at 11.44.00 PM](https://us1.discourse-cdn.com/flex002/uploads/haskell/original/2X/6/6e056e22b656fbde3383fb53c7da5ee8fe695731.png)

But the fun part was implementing the core logic without depending on external libraries.  
The result is an eDSL to create an explanation template for either Conway’s or alternative versions:

```Haskell
findYearAnchorNakai =
  part "Find the year anchor." $ startingWithYear 'Y' $ \y -> do
    c1 <- stepI "first take the century digits" $ 'C' := y `div` 100
    c2 <- stepI "and remainder dividing by four" $ 'C' := c1 `mod` 4
    d1 <- stepI "then take the last two digits" $ 'D' := y `mod` 100
    d2 <- stepI "and remainder dividing by four" $ 'E' := d1 `mod` 4
    step "add together to get" $ 'W' := 5 * (c2 + d2 - 1) + 10 * d1

```

This may look daunting, but after adding each number modulo 7 a weekday pops out.

From technical perspective, I really liked splitting the explanation, evaluation and pretty-printing.  
Years ago I tried simplifying the math manually in Swift in string interpolation and it was buggy and inconsistent.  
So I decided to do it right(™) in Haskell!

I hope some of you find this fun and can use it to amaze your friends and colleagues. 😉
