module Data.Vector.Optics
( toVectorOf
, vector
, forced
, sliced
, ordinals
) where
import Data.Vector (Vector)
import Optics.Core
import qualified Data.Vector.Generic.Optics as G
sliced
:: Int
-> Int
-> Lens' (Vector a) (Vector a)
sliced :: Int -> Int -> Lens' (Vector a) (Vector a)
sliced = Int -> Int -> Lens' (Vector a) (Vector a)
forall (v :: * -> *) a.
Vector v a =>
Int -> Int -> Lens' (v a) (v a)
G.sliced
{-# INLINE sliced #-}
toVectorOf
:: Is k A_Fold
=> Optic' k is s a
-> s
-> Vector a
toVectorOf :: Optic' k is s a -> s -> Vector a
toVectorOf = Optic' k is s a -> s -> Vector a
forall k (v :: * -> *) a (is :: IxList) s.
(Is k A_Fold, Vector v a) =>
Optic' k is s a -> s -> v a
G.toVectorOf
{-# INLINE toVectorOf #-}
vector :: Iso [a] [b] (Vector a) (Vector b)
vector :: Iso [a] [b] (Vector a) (Vector b)
vector = Iso [a] [b] (Vector a) (Vector b)
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
Iso [a] [b] (v a) (v b)
G.vector
{-# INLINE vector #-}
forced :: Iso (Vector a) (Vector b) (Vector a) (Vector b)
forced :: Iso (Vector a) (Vector b) (Vector a) (Vector b)
forced = Iso (Vector a) (Vector b) (Vector a) (Vector b)
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
Iso (v a) (v b) (v a) (v b)
G.forced
{-# INLINE forced #-}
ordinals :: forall a. [Int] -> IxTraversal' Int (Vector a) a
ordinals :: [Int] -> IxTraversal' Int (Vector a) a
ordinals = [Int] -> IxTraversal' Int (Vector a) a
forall (v :: * -> *) a.
Vector v a =>
[Int] -> IxTraversal' Int (v a) a
G.ordinals
{-# INLINE ordinals #-}