Hoogle Search

Within LTS Haskell 24.69 (ghc-9.10.3)

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

  1. toMap :: Sorting k => [(k, v)] -> Map k v

    discrimination Data.Discrimination.Sorting

    O(n). Construct a Map. This is an asymptotically faster version of fromList, which exploits ordered discrimination.

    >>> toMap []
    fromList []
    
    >>> toMap [(5,"a"), (3 :: Int,"b"), (5, "c")]
    fromList [(3,"b"),(5,"c")]
    
    >>> Map.fromList [(5,"a"), (3 :: Int,"b"), (5, "c")]
    fromList [(3,"b"),(5,"c")]
    
    >>> toMap [(5,"c"), (3,"b"), (5 :: Int, "a")]
    fromList [(3,"b"),(5,"a")]
    
    >>> Map.fromList [(5,"c"), (3,"b"), (5 :: Int, "a")]
    fromList [(3,"b"),(5,"a")]
    

  2. toMapWith :: Sorting k => (v -> v -> v) -> [(k, v)] -> Map k v

    discrimination Data.Discrimination.Sorting

    O(n). Construct a Map, combining values. This is an asymptotically faster version of fromListWith, which exploits ordered discrimination. (Note: values combine in anti-stable order for compatibility with fromListWith)

    >>> toMapWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5 :: Int,"c")]
    fromList [(3,"ab"),(5,"cba")]
    
    >>> Map.fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5 :: Int,"c")]
    fromList [(3,"ab"),(5,"cba")]
    
    >>> toMapWith (++) []
    fromList []
    

  3. toMapWithKey :: Sorting k => (k -> v -> v -> v) -> [(k, v)] -> Map k v

    discrimination Data.Discrimination.Sorting

    O(n). Construct a Map, combining values with access to the key. This is an asymptotically faster version of fromListWithKey, which exploits ordered discrimination. (Note: the values combine in anti-stable order for compatibility with fromListWithKey)

    >>> let f key new_value old_value = show key ++ ":" ++ new_value ++ "|" ++ old_value
    
    >>> toMapWithKey f [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5 :: Int,"c")]
    fromList [(3,"3:a|b"),(5,"5:c|5:b|a")]
    
    >>> toMapWithKey f []
    fromList []
    

  4. cmap :: Typeable a => StaticPtr (a -> b) -> Closure a -> Closure b

    distributed-closure Control.Distributed.Closure

    Deprecated: Use staticMap instead.

  5. cmap :: Typeable a => StaticPtr (a -> b) -> Closure a -> Closure b

    distributed-closure Control.Distributed.Closure.Internal

    Deprecated: Use staticMap instead.

  6. staticMap :: (StaticFunctor f, Typeable a, Typeable b) => Closure (a -> b) -> f a -> f b

    distributed-closure Data.Functor.Static

    No documentation available.

  7. staticDimap :: (StaticProfunctor p, Typeable a, Typeable b, Typeable c, Typeable d) => Closure (a -> b) -> Closure (c -> d) -> p b c -> p a d

    distributed-closure Data.Profunctor.Static

    No documentation available.

  8. staticLmap :: (StaticProfunctor p, Typeable a, Typeable b, Typeable c) => Closure (a -> b) -> p b c -> p a c

    distributed-closure Data.Profunctor.Static

    No documentation available.

  9. staticRmap :: (StaticProfunctor p, Typeable a, Typeable c, Typeable d) => Closure (c -> d) -> p a c -> p a d

    distributed-closure Data.Profunctor.Static

    No documentation available.

  10. concatMap :: Foldable t => (a -> [b]) -> t a -> [b]

    distribution-opensuse OpenSuse.Prelude

    Map a function over all the elements of a container and concatenate the resulting lists.

    Examples

    Basic usage:
    >>> concatMap (take 3) [[1..], [10..], [100..], [1000..]]
    [1,2,3,10,11,12,100,101,102,1000,1001,1002]
    
    >>> concatMap (take 3) (Just [1..])
    [1,2,3]
    

Page 1148 of many | Previous | Next