Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
Can a type be designed to capture these two invariants?
image.png
(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"?
cool
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.
https://hackage.haskell.org/package/non-empty-zipper-0.1.0.9/docs/Data-List-NonEmptyZipper.html
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
https://github.com/srid/ka/commit/6c07fe411ca4a8831b1fa5604b11c30dc4450842
/me derives Foldable to simplify further
Foldable
Can a type be designed to capture these two invariants?
image.png
(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"?
cool
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.
https://hackage.haskell.org/package/non-empty-zipper-0.1.0.9/docs/Data-List-NonEmptyZipper.html
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
https://github.com/srid/ka/commit/6c07fe411ca4a8831b1fa5604b11c30dc4450842
/me derives
Foldable
to simplify further