Create Control.Zipper
Most of this code is ported from the haskell `zippers` library.
This commit is contained in:
parent
e0297af9f3
commit
de087603bf
2 changed files with 141 additions and 1 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue