I'm trying to remove an element from an Array a using the index of the element but I can't find a way to do it with Lenses. I'm also wondering why Array does not provide an instance for the At lens. Any pointer on it?
How to delete an element from an array using lenses
79 views Asked by amaille At
1
You can look at the
Control.Lens.Atmodule docs for a hint:One of the laws which breaks is
set l v' (set l v s) ≡ set l v' s. The reason being that deleting an index moves the other indices. So the following can't make sense:I don't know of a way to have deleting array elements be Lens like.