^. -package:stack package:lens

View the value pointed to by a Getter or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal values. This is the same operation as view with the arguments flipped. The fixity and semantics are such that subsequent field accesses can be performed with (.).
>>> (a,b)^._2
b
>>> ("hello","world")^._2
"world"
>>> import Data.Complex

>>> ((0, 1 :+ 2), 3)^._1._2.to magnitude
2.23606797749979
(^.) ::             s -> Getter s a     -> a
(^.) :: Monoid m => s -> Fold s m       -> m
(^.) ::             s -> Iso' s a       -> a
(^.) ::             s -> Lens' s a      -> a
(^.) :: Monoid m => s -> Traversal' s m -> m
A convenient infix (flipped) version of toListOf.
>>> [[1,2],[3]]^..id
[[[1,2],[3]]]

>>> [[1,2],[3]]^..traverse
[[1,2],[3]]

>>> [[1,2],[3]]^..traverse.traverse
[1,2,3]
>>> (1,2)^..both
[1,2]
toList xs ≡ xs ^.. folded
(^..) ≡ flip toListOf
(^..) :: s -> Getter s a     -> a :: s -> Fold s a       -> a :: s -> Lens' s a      -> a :: s -> Iso' s a       -> a :: s -> Traversal' s a -> a :: s -> Prism' s a     -> [a]