Hoogle Search

Within LTS Haskell 24.34 (ghc-9.10.3)

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

  1. gmapM :: (GTraversable t, Monad m) => (a -> m b) -> t a -> m (t b)

    generic-deriving Generics.Deriving.Traversable

    No documentation available.

  2. foldl1Map :: forall (f :: Type -> Type) b a . Foldable f => (b -> b -> b) -> (a -> b) -> T f a -> b

    non-empty Data.NonEmpty

    It holds:

    foldl1Map f g = foldl1 f . fmap g
    
    but foldl1Map does not need a Functor instance.

  3. toMapOf :: forall k (is :: IxList) s a . (Is k A_Fold, HasSingleIndex is Int) => Optic' k is s a -> s -> IntMap a

    optics-core Data.IntMap.Optics

    Construct a map from an IxFold. The construction is left-biased (see union), i.e. the first occurrences of keys in the fold or traversal order are preferred.

    >>> toMapOf ifolded ["hello", "world"]
    fromList [(0,"hello"),(1,"world")]
    
    >>> toMapOf (folded % ifolded) [(1,"alpha"),(2, "beta")]
    fromList [(1,"alpha"),(2,"beta")]
    
    >>> toMapOf (icompose (\a b -> 10*a+b) $ ifolded % ifolded) ["foo", "bar"]
    fromList [(0,'f'),(1,'o'),(2,'o'),(10,'b'),(11,'a'),(12,'r')]
    
    >>> toMapOf (folded % ifolded) [(1, "hello"), (2, "world"), (1, "dummy")]
    fromList [(1,"hello"),(2,"world")]
    

  4. setmapped :: Setter' IntSet Int

    optics-core Data.IntSet.Optics

    This Setter can be used to change the type of a IntSet by mapping the elements to new values. Sadly, you can't create a valid Traversal for an IntSet, but you can manipulate it by reading using folded and reindexing it via setmapped.

    >>> over setmapped (+1) (IntSet.fromList [1,2,3,4])
    fromList [2,3,4,5]
    

  5. toMapOf :: forall k (is :: IxList) i s a . (Is k A_Fold, HasSingleIndex is i, Ord i) => Optic' k is s a -> s -> Map i a

    optics-core Data.Map.Optics

    Construct a map from an IxFold. The construction is left-biased (see union), i.e. the first occurrences of keys in the fold or traversal order are preferred.

    >>> toMapOf ifolded ["hello", "world"]
    fromList [(0,"hello"),(1,"world")]
    
    >>> toMapOf (folded % ifolded) [('a',"alpha"),('b', "beta")]
    fromList [('a',"alpha"),('b',"beta")]
    
    >>> toMapOf (ifolded <%> ifolded) ["foo", "bar"]
    fromList [((0,0),'f'),((0,1),'o'),((0,2),'o'),((1,0),'b'),((1,1),'a'),((1,2),'r')]
    
    >>> toMapOf (folded % ifolded) [('a', "hello"), ('b', "world"), ('a', "dummy")]
    fromList [('a',"hello"),('b',"world")]
    

  6. setmapped :: Ord b => Setter (Set a) (Set b) a b

    optics-core Data.Set.Optics

    This Setter can be used to change the type of a Set by mapping the elements to new values. Sadly, you can't create a valid Traversal for a Set, but you can manipulate it by reading using folded and reindexing it via setmapped.

    >>> over setmapped (+1) (Set.fromList [1,2,3,4])
    fromList [2,3,4,5]
    

  7. foldMapOf :: forall k m (is :: IxList) s a . (Is k A_Fold, Monoid m) => Optic' k is s a -> (a -> m) -> s -> m

    optics-core Optics.Fold

    Fold via embedding into a monoid.

  8. ifoldMap :: (FoldableWithIndex i f, Monoid m) => (i -> a -> m) -> f a -> m

    optics-core Optics.Indexed.Core

    Fold a container by mapping value to an arbitrary Monoid with access to the index i. When you don't need access to the index then foldMap is more flexible in what it accepts.

    foldMapifoldMap . const
    

  9. ifoldMap' :: (FoldableWithIndex i f, Monoid m) => (i -> a -> m) -> f a -> m

    optics-core Optics.Indexed.Core

    A variant of ifoldMap that is strict in the accumulator. When you don't need access to the index then foldMap' is more flexible in what it accepts.

    foldMap'ifoldMap' . const
    

  10. imap :: FunctorWithIndex i f => (i -> a -> b) -> f a -> f b

    optics-core Optics.Indexed.Core

    Map with access to the index.

Page 482 of many | Previous | Next