ral-optics-0.1: Length-indexed random access lists: optics utilities.

Safe HaskellNone
LanguageHaskell2010

Data.RAVec.Tree.Optics

Contents

Synopsis

Indexing

ix :: Wrd n -> Lens' (Tree n a) a Source #

Index lens.

>>> let tree = Node (Node (Leaf 'a') (Leaf 'b')) (Node (Leaf 'c') (Leaf 'd'))
>>> set (ix (W1 $ W0 WE)) 'z' tree
Node (Node (Leaf 'a') (Leaf 'b')) (Node (Leaf 'z') (Leaf 'd'))

Orphan instances

FunctorWithIndex (Wrd n) (Tree n) Source # 
Instance details

Methods

imap :: (Wrd n -> a -> b) -> Tree n a -> Tree n b #

FoldableWithIndex (Wrd n) (Tree n) Source # 
Instance details

Methods

ifoldMap :: Monoid m => (Wrd n -> a -> m) -> Tree n a -> m #

ifoldr :: (Wrd n -> a -> b -> b) -> b -> Tree n a -> b #

ifoldl' :: (Wrd n -> b -> a -> b) -> b -> Tree n a -> b #

TraversableWithIndex (Wrd n) (Tree n) Source # 
Instance details

Methods

itraverse :: Applicative f => (Wrd n -> a -> f b) -> Tree n a -> f (Tree n b) #

Each (Wrd n) (Tree n a) (Tree n b) a b Source # 
Instance details

Methods

each :: IxTraversal (Wrd n) (Tree n a) (Tree n b) a b #

Ixed (Tree n a) Source # 
Instance details

Associated Types

type IxKind (Tree n a) :: OpticKind #

Methods

ix :: Index (Tree n a) -> Optic' (IxKind (Tree n a)) NoIx (Tree n a) (IxValue (Tree n a)) #