Now that I have the probability library published, I’m moving on to more experiments with the odd implementation style I used. So far I really like it! It makes representing algebraic data types verbose but mostly mechanical, and it adds extensibility in weird places. At the moment I’m working on linked lists which can be both strict and lazy (what else would you get if you concatenated a strict list onto a lazy list or vice versa?) There’s a lot to experiment with still. Like, it’s easy have a lazy list backed by an iterable, which caches values as it goes (because iterables are terrible). Slightly more interesting is backing a list (lazy or strict) with an already existing array, without needless copying. There’s trickiness that I haven’t figured out yet as to how I can efficiently map over arbitrary combinations of these with a minimum of wasted work while still maintaining stack safety.
I love winter break. So much time for activities.