Create Control.Zipper

Most of this code is ported from the haskell `zippers` library.
This commit is contained in:
Kiana Sheibani 2023-04-22 23:45:00 -04:00
parent e0297af9f3
commit de087603bf
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 141 additions and 1 deletions

View file

@ -121,7 +121,7 @@ public export
(<.) l l' @{ind} = l @{Idxed} . runIndexed . l' . MkIndexed {p} . indexed @{ind}
||| Augment an optic with a constant index.
||| Augment an optic with an index that is constant for all inputs.
public export
constIndex : IsIso p => i -> Optic' p s t a b -> IndexedOptic' p i s t a b
constIndex i l @{MkIsIso _} @{ind} = l . lmap (i,) . indexed @{ind}