Hoogle Search
Within LTS Haskell 24.20 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
(
^@.. ) :: s -> IndexedGetting i (Endo [(i, a)]) s a -> [(i, a)]lens Control.Lens.Fold An infix version of itoListOf.
(
^. ) :: s -> Getting a s a -> alens Control.Lens.Getter 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
(
^@. ) :: s -> IndexedGetting i (i, a) s a -> (i, a)lens Control.Lens.Getter View the index and value of an IndexedGetter or IndexedLens. This is the same operation as iview with the arguments flipped. The fixity and semantics are such that subsequent field accesses can be performed with (.).
(^@.) :: s -> IndexedGetter i s a -> (i, a) (^@.) :: s -> IndexedLens' i s a -> (i, a)
The result probably doesn't have much meaning when applied to an IndexedFold.(
<. ) :: Indexable i p => (Indexed i s t -> r) -> ((a -> b) -> s -> t) -> p a b -> rlens Control.Lens.Indexed Compose an Indexed function with a non-indexed function. Mnemonically, the < points to the indexing we want to preserve.
>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])] >>> nestedMap^..(itraversed<.itraversed).withIndex [(1,"one,ten"),(1,"one,twenty"),(2,"two,thirty"),(2,"two,forty")]
(
<.> ) :: Indexable (i, j) p => (Indexed i s t -> r) -> (Indexed j a b -> s -> t) -> p a b -> rlens Control.Lens.Indexed Composition of Indexed functions. Mnemonically, the < and > points to the fact that we want to preserve the indices.
>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])] >>> nestedMap^..(itraversed<.>itraversed).withIndex [((1,10),"one,ten"),((1,20),"one,twenty"),((2,30),"two,thirty"),((2,40),"two,forty")]
(
<<.= ) :: MonadState s m => LensLike ((,) a) s s a b -> b -> m alens Control.Lens.Lens Replace the target of a Lens into your Monad's state with a user supplied value and return the old value that was replaced. When applied to a Traversal, this will return a monoidal summary of all of the old values present. When you do not need the result of the operation, (.=) is more flexible.
(<<.=) :: MonadState s m => Lens' s a -> a -> m a (<<.=) :: MonadState s m => Iso' s a -> a -> m a (<<.=) :: (MonadState s m, Monoid a) => Traversal' s a -> a -> m a
(
<<.~ ) :: LensLike ((,) a) s t a b -> b -> s -> (a, t)lens Control.Lens.Lens Replace the target of a Lens, but return the old value. When you do not need the old value, (.~) is more flexible.
(<<.~) :: Lens s t a b -> b -> s -> (a, t) (<<.~) :: Iso s t a b -> b -> s -> (a, t) (<<.~) :: Monoid a => Traversal s t a b -> b -> s -> (a, t)
(
<. ) :: Indexable i p => (Indexed i s t -> r) -> ((a -> b) -> s -> t) -> p a b -> rlens Control.Lens.Operators Compose an Indexed function with a non-indexed function. Mnemonically, the < points to the indexing we want to preserve.
>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])] >>> nestedMap^..(itraversed<.itraversed).withIndex [(1,"one,ten"),(1,"one,twenty"),(2,"two,thirty"),(2,"two,forty")]
(
<.= ) :: MonadState s m => ASetter s s a b -> b -> m blens Control.Lens.Operators Set with pass-through This is useful for chaining assignment without round-tripping through your Monad stack.
do x <- _2 <.= ninety_nine_bottles_of_beer_on_the_wall
If you do not need a copy of the intermediate result, then using l .= d will avoid unused binding warnings.(<.=) :: MonadState s m => Setter s s a b -> b -> m b (<.=) :: MonadState s m => Iso s s a b -> b -> m b (<.=) :: MonadState s m => Lens s s a b -> b -> m b (<.=) :: MonadState s m => Traversal s s a b -> b -> m b
(
<.> ) :: Indexable (i, j) p => (Indexed i s t -> r) -> (Indexed j a b -> s -> t) -> p a b -> rlens Control.Lens.Operators Composition of Indexed functions. Mnemonically, the < and > points to the fact that we want to preserve the indices.
>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])] >>> nestedMap^..(itraversed<.>itraversed).withIndex [((1,10),"one,ten"),((1,20),"one,twenty"),((2,30),"two,thirty"),((2,40),"two,forty")]