Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
Can a type be designed to capture these two invariants?
(FWIW, this kind of breadcrumbs is to mimick the stacking behaviour of https://notes.andymatuschak.org/About_these_notes )
two lists for "before" and "after"?
So it is basically a non-empty list with a pointer (to an existing element).
a zipper, if you will
But I won't be modifying the pointed value. Just moving the pointer around, or adding a new element and changing the pointer to point to it.
this looks like it
lol it is the same type
I just wrote this image.png
it is also written by our fellow Isaac Shapira
/me derives Foldable to simplify further