Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. (.>) :: (st -> r) -> (kab -> st) -> kab -> r

    lens Control.Lens.Operators

    Compose a non-indexed function with an Indexed function. Mnemonically, the > points to the indexing we want to preserve. This is the same as (.). f . g (and f .> g) gives you the index of g unless g is index-preserving, like a Prism, Iso or Equality, in which case it'll pass through the index of f.

    >>> 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
    [(10,"one,ten"),(20,"one,twenty"),(30,"two,thirty"),(40,"two,forty")]
    

  2. (.@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> b) -> m ()

    lens Control.Lens.Operators

    Replace every target in the current state of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index. When you do not need access to the index then (.=) is more liberal in what it can accept.

    l .= b ≡ l .@= const b
    
    (.@=) :: MonadState s m => IndexedSetter i s s a b    -> (i -> b) -> m ()
    (.@=) :: MonadState s m => IndexedLens i s s a b      -> (i -> b) -> m ()
    (.@=) :: MonadState s m => IndexedTraversal i s t a b -> (i -> b) -> m ()
    

  3. (.@~) :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t

    lens Control.Lens.Operators

    Replace every target of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

    (.@~) ≡ iset
    
    When you do not need access to the index then (.~) is more liberal in what it can accept.
    l .~ b ≡ l .@~ const b
    
    (.@~) :: IndexedSetter i s t a b    -> (i -> b) -> s -> t
    (.@~) :: IndexedLens i s t a b      -> (i -> b) -> s -> t
    (.@~) :: IndexedTraversal i s t a b -> (i -> b) -> s -> t
    

  4. (.~) :: ASetter s t a b -> b -> s -> t

    lens Control.Lens.Operators

    Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value. This is an infix version of set, provided for consistency with (.=).

    f <$ a ≡ mapped .~ f $ a
    
    >>> (a,b,c,d) & _4 .~ e
    (a,b,c,e)
    
    >>> (42,"world") & _1 .~ "hello"
    ("hello","world")
    
    >>> (a,b) & both .~ c
    (c,c)
    
    (.~) :: Setter s t a b    -> b -> s -> t
    (.~) :: Iso s t a b       -> b -> s -> t
    (.~) :: Lens s t a b      -> b -> s -> t
    (.~) :: Traversal s t a b -> b -> s -> t
    

  5. (.=) :: MonadState s m => ASetter s s a b -> b -> m ()

    lens Control.Lens.Setter

    Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with a new value, irrespective of the old. This is an infix version of assign.

    >>> execState (do _1 .= c; _2 .= d) (a,b)
    (c,d)
    
    >>> execState (both .= c) (a,b)
    (c,c)
    
    (.=) :: MonadState s m => Iso' s a       -> a -> m ()
    (.=) :: MonadState s m => Lens' s a      -> a -> m ()
    (.=) :: MonadState s m => Traversal' s a -> a -> m ()
    (.=) :: MonadState s m => Setter' s a    -> a -> m ()
    
    It puts the state in the monad or it gets the hose again.

  6. (.@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> b) -> m ()

    lens Control.Lens.Setter

    Replace every target in the current state of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index. When you do not need access to the index then (.=) is more liberal in what it can accept.

    l .= b ≡ l .@= const b
    
    (.@=) :: MonadState s m => IndexedSetter i s s a b    -> (i -> b) -> m ()
    (.@=) :: MonadState s m => IndexedLens i s s a b      -> (i -> b) -> m ()
    (.@=) :: MonadState s m => IndexedTraversal i s t a b -> (i -> b) -> m ()
    

  7. (.@~) :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t

    lens Control.Lens.Setter

    Replace every target of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

    (.@~) ≡ iset
    
    When you do not need access to the index then (.~) is more liberal in what it can accept.
    l .~ b ≡ l .@~ const b
    
    (.@~) :: IndexedSetter i s t a b    -> (i -> b) -> s -> t
    (.@~) :: IndexedLens i s t a b      -> (i -> b) -> s -> t
    (.@~) :: IndexedTraversal i s t a b -> (i -> b) -> s -> t
    

  8. (.~) :: ASetter s t a b -> b -> s -> t

    lens Control.Lens.Setter

    Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value. This is an infix version of set, provided for consistency with (.=).

    f <$ a ≡ mapped .~ f $ a
    
    >>> (a,b,c,d) & _4 .~ e
    (a,b,c,e)
    
    >>> (42,"world") & _1 .~ "hello"
    ("hello","world")
    
    >>> (a,b) & both .~ c
    (c,c)
    
    (.~) :: Setter s t a b    -> b -> s -> t
    (.~) :: Iso s t a b       -> b -> s -> t
    (.~) :: Lens s t a b      -> b -> s -> t
    (.~) :: Traversal s t a b -> b -> s -> t
    

  9. (.&.=) :: (MonadState s m, Bits a) => ASetter' s a -> a -> m ()

    lens Data.Bits.Lens

    Modify the target(s) of a Lens', Setter' or Traversal' by computing its bitwise .&. with another value.

    >>> execState (do _1 .&.= 15; _2 .&.= 3) (7,7)
    (7,3)
    
    (.&.=) :: (MonadState s m, Bits a) => Setter' s a    -> a -> m ()
    (.&.=) :: (MonadState s m, Bits a) => Iso' s a       -> a -> m ()
    (.&.=) :: (MonadState s m, Bits a) => Lens' s a      -> a -> m ()
    (.&.=) :: (MonadState s m, Bits a) => Traversal' s a -> a -> m ()
    

  10. (.&.~) :: Bits a => ASetter s t a a -> a -> s -> t

    lens Data.Bits.Lens

    Bitwise .&. the target(s) of a Lens or Setter.

    >>> _2 .&.~ 7 $ ("hello",254)
    ("hello",6)
    
    (.&.~) :: Bits a             => Setter s t a a    -> a -> s -> t
    (.&.~) :: Bits a             => Iso s t a a       -> a -> s -> t
    (.&.~) :: Bits a             => Lens s t a a      -> a -> s -> t
    (.&.~) :: (Monoid a, Bits a) => Traversal s t a a -> a -> s -> t
    

Page 9 of many | Previous | Next