Getting recursive definitions off their bottoms (bobkonf2023)

Published: March 17, 2023, 1:15 p.m.

b'Haskell claims to be a declarative language, where you just write down some equations, and suddenly the variables contain the solution to these equations. This works even with recursive equations, but only in some cases: defining recursive functions, of course, but also cyclic data structures. One can even apply so-called knot-tying tricks, where a lazy data structure is filled with values that refer to that data structure! For example, one can very elegantly calculate the reachable nodes in a graph.\\n\\n\\u2026until the graph is cyclic, and suddenly our nice elegant Haskell program silently runs in circles and will not produce an answer.\\n\\nThis is unfortunate: The involved equations, although recursive, do nicely declaratively describe the solution we want! So let\\u2019s make it happen!\\n\\nWe\\u2019ll see types (Booleans, Sets) that seem to behave just like the normal ones, but recursive definitions somehow magically produce the expected result. And all that in pure code, no monads anywhere! We\\u2019ll see a few use cases that can suddenly be solved much more elegantly.\\n\\nThen we\\u2019ll look under the hood of this (arguably) safe API, won\\u2019t be deterred by unsafePerformIO, and find some very imperative, monad-infested, concurrency-worried code that implements a form of \\u201cpropagator\\u201d. We\\u2019ll notice that there is plenty we can do to improve their performance, but won\\u2019t actually go there. Instead, we\\u2019ll turn back to the \\u201cpure\\u201d interface and discuss together if that is still really \\u201cpure\\u201d.\\nabout this event: https://bobkonf.de/2023/breitner.html'