Safe Haskell | None |
---|---|
Language | Haskell2010 |
Indexing
ix :: Fin n -> Lens' (Vec n a) a Source #
Index lens.
>>>
('a' L.::: 'b' L.::: 'c' L.::: L.VNil) ^. L._Pull . ix (FS FZ)
'b'
>>>
('a' L.::: 'b' L.::: 'c' L.::: L.VNil) & L._Pull . ix (FS FZ) .~ 'x'
'a' ::: 'x' ::: 'c' ::: VNil
_head :: Lens' (Vec (S n) a) a Source #
Head lens. Note: lens
_head
is a Traversal'
.
>>>
('a' L.::: 'b' L.::: 'c' L.::: L.VNil) ^. L._Pull . _head
'a'
>>>
('a' L.::: 'b' L.::: 'c' L.::: L.VNil) & L._Pull . _head .~ 'x'
'x' ::: 'b' ::: 'c' ::: VNil
Conversions
Orphan instances
FunctorWithIndex (Fin n) (Vec n) Source # | |
SNatI n => FoldableWithIndex (Fin n) (Vec n) Source # | |