News for hackers. Stuff that matters.
Re:Time Travel in Haskell for Dummies by Throwaway234590 on Saturday January 28, 2023 @10:01PM (#34564421)
This year's Advent of Code had a problem where you had to check the visibility of trees in a forest from both sides, (actually four sides, but consider two sides). You needed to read in an entire array of tree heights, and walk back from both sides into the centre to check if each tree was visible.

Because Haskell reads in the entire array before beginning processing, you can create semantics that walk backwards and forwards to solve this problem all in one go. That is what the Tardis monad is about.

There are no comments on this comment yet.