| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Optics.Arrow
Description
Documentation
class Arrow arr => ArrowOptic k arr where Source #
Methods
overA :: Optic k is s t a b -> arr a b -> arr s t Source #
Turn an optic into an arrow transformer.
Instances
| ArrowChoice arr => ArrowOptic An_AffineTraversal arr Source # | |
Defined in Optics.Arrow Methods overA :: Optic An_AffineTraversal is s t a b -> arr a b -> arr s t Source # | |
| ArrowChoice arr => ArrowOptic A_Prism arr Source # | |
| Arrow arr => ArrowOptic A_Lens arr Source # | |
| Arrow arr => ArrowOptic An_Iso arr Source # | |
assignA :: (Is k A_Setter, Arrow arr) => Optic k is s t a b -> arr s b -> arr s t Source #
Run an arrow command and use the output to set all the targets of an optic to the result.
runKleisli action ((), (), ()) where
action = assignA _1 (Kleisli (const getVal1))
>>> assignA _2 (Kleisli (const getVal2))
>>> assignA _3 (Kleisli (const getVal3))
getVal1 :: Either String Int
getVal1 = ...
getVal2 :: Either String Bool
getVal2 = ...
getVal3 :: Either String Char
getVal3 = ...