talk · community record
This programmer modeled his code after w...
Recursion has been called the GOTO of FP, yet we use it constantly – every `List` operation, every event loop, and myriad other places – it litters our code. So, how can we tame it? Can we at least contain it, if not eliminate it entirely? This talk introduces a new Typelevel library intended to free us from primitive recursion. Matryoshka contains a family of folds, unfolds, and transformations that can be applied to any recursive structure. We’ll learn how to separate the recursion from our logic and write “flat” operations that are more readily checkable by the compiler. We’ll also look at how the library allows us to fuse many transformations into one, handle short-circuiting, and even annotate data structures for free.