Hoogle Search

Within LTS Haskell 24.33 (ghc-9.10.3)

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

  1. mapAsWord64 :: ByteArray bs => (Word64 -> Word64) -> bs -> bs

    memory Data.ByteArray.Mapping

    map blocks of 64 bits of a bytearray, creating a new bytestring of equivalent size where each blocks has been mapped through f no length checking is done. unsafe

  2. mapSplitter :: (b -> a) -> Splitter a -> Splitter b

    split Data.List.Split

    Split over a different type of element by performing a preprocessing step.

    >>> split (mapSplitter snd $ oneOf "-_") $ zip [0..] "a-bc_d"
    [[(0,'a')],[(1,'-')],[(2,'b'),(3,'c')],[(4,'_')],[(5,'d')]]
    
    >>> import Data.Char (toLower)
    
    >>> split (mapSplitter toLower $ dropDelims $ whenElt (== 'x')) "abXcxd"
    ["ab","c","d"]
    

  3. mapSplitter :: (b -> a) -> Splitter a -> Splitter b

    split Data.List.Split.Internals

    Split over a different type of element by performing a preprocessing step.

    >>> split (mapSplitter snd $ oneOf "-_") $ zip [0..] "a-bc_d"
    [[(0,'a')],[(1,'-')],[(2,'b'),(3,'c')],[(4,'_')],[(5,'d')]]
    
    >>> import Data.Char (toLower)
    
    >>> split (mapSplitter toLower $ dropDelims $ whenElt (== 'x')) "abXcxd"
    ["ab","c","d"]
    

  4. mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

    microlens Lens.Micro

    This generalizes mapAccumL to an arbitrary Traversal. (Note that it doesn't work on folds, only traversals.)

    mapAccumLmapAccumLOf traverse
    

  5. mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t

    microlens Lens.Micro

    Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results.

    >>> mapMOf both (\x -> [x, x + 1]) (1,3)
    [(1,3),(1,4),(2,3),(2,4)]
    

  6. mapped :: Functor f => ASetter (f a) (f b) a b

    microlens Lens.Micro

    mapped is a setter for everything contained in a functor. You can use it to map over lists, Maybe, or even IO (which is something you can't do with traversed or each). Here mapped is used to turn a value to all non-Nothing values in a list:

    >>> [Just 3,Nothing,Just 5] & mapped.mapped .~ 0
    [Just 0,Nothing,Just 0]
    
    Keep in mind that while mapped is a more powerful setter than each, it can't be used as a getter! This won't work (and will fail with a type error):
    [(1,2),(3,4),(5,6)] ^.. mapped . both
    

  7. mapLeafBenchmarks :: ([String] -> Benchmark -> Benchmark) -> Benchmark -> Benchmark

    tasty-bench Test.Tasty.Bench

    Map leaf benchmarks (bench, not bgroup) with a provided function, which has an access to leaf's reversed path. This helper is useful for bulk application of bcompare. See also locateBenchmark. Real world examples:

  8. map' :: (Mapping p, Functor f) => p a b -> p (f a) (f b)

    profunctors Data.Profunctor

    Laws:

    map' . rmap f ≡ rmap (fmap f) . map'
    map' . map'dimap Compose getCompose . map'
    dimap Identity runIdentity . map'id
    

  9. map' :: (Mapping p, Functor f) => p a b -> p (f a) (f b)

    profunctors Data.Profunctor.Mapping

    Laws:

    map' . rmap f ≡ rmap (fmap f) . map'
    map' . map'dimap Compose getCompose . map'
    dimap Identity runIdentity . map'id
    

  10. mapParseError :: Ord e' => (e -> e') -> ParseError s e -> ParseError s e'

    megaparsec Text.Megaparsec.Error

    Modify the custom data component in a parse error. This could be done via fmap if not for the Ord constraint.

Page 83 of many | Previous | Next