Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Indexing
ix :: Fin n -> Lens' (Vec n a) a Source #
Index lens.
>>>
('a' ::: 'b' ::: 'c' ::: VNil) ^. ix (FS FZ)
'b'
>>>
('a' ::: 'b' ::: 'c' ::: VNil) & 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' ::: 'b' ::: 'c' ::: VNil) ^. _head
'a'
>>>
('a' ::: 'b' ::: 'c' ::: VNil) & _head .~ 'x'
'x' ::: 'b' ::: 'c' ::: VNil
Conversions
_Vec :: SNatI n => Prism' [a] (Vec n a) Source #
Prism from list.
>>>
"foo" ^? _Vec :: Maybe (Vec N.Nat3 Char)
Just ('f' ::: 'o' ::: 'o' ::: VNil)
>>>
"foo" ^? _Vec :: Maybe (Vec N.Nat2 Char)
Nothing
>>>
_Vec # (True ::: False ::: VNil)
[True,False]
Orphan instances
Ixed (Vec n a) Source # |
|
Each (Vec n a) (Vec n b) a b Source # | |
Field1 (Vec ('S n) a) (Vec ('S n) a) a a Source # | |
Field2 (Vec ('S ('S n)) a) (Vec ('S ('S n)) a) a a Source # | |
Field3 (Vec ('S ('S ('S n))) a) (Vec ('S ('S ('S n))) a) a a Source # | |
Field4 (Vec ('S ('S ('S ('S n)))) a) (Vec ('S ('S ('S ('S n)))) a) a a Source # | |
Field5 (Vec ('S ('S ('S ('S ('S n))))) a) (Vec ('S ('S ('S ('S ('S n))))) a) a a Source # | |
Field6 (Vec ('S ('S ('S ('S ('S ('S n)))))) a) (Vec ('S ('S ('S ('S ('S ('S n)))))) a) a a Source # | |
Field7 (Vec ('S ('S ('S ('S ('S ('S ('S n))))))) a) (Vec ('S ('S ('S ('S ('S ('S ('S n))))))) a) a a Source # | |
Field8 (Vec ('S ('S ('S ('S ('S ('S ('S ('S n)))))))) a) (Vec ('S ('S ('S ('S ('S ('S ('S ('S n)))))))) a) a a Source # | |
Field9 (Vec ('S ('S ('S ('S ('S ('S ('S ('S ('S n))))))))) a) (Vec ('S ('S ('S ('S ('S ('S ('S ('S ('S n))))))))) a) a a Source # | |