Could tail be a fold?

Did you know you can write a safe version of the tail function as a fold? Did you know you can’t? Let me start with the second question. In this very interesting paper from some years ago, illustrious authors give necessary and sufficient conditions for when a function can be expressed as a fold (or […]