Hoogle Search

Within LTS Haskell 24.40 (ghc-9.10.3)

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

  1. data HashMap k v

    rio RIO.HashMap

    A map from keys to values. A map cannot contain duplicate keys; each key can map to at most one value.

  2. fromMap :: HashMap a () -> HashSet a

    rio RIO.HashSet

    Convert from the equivalent HashMap with () values.

    >>> HashSet.fromMap (HashMap.singleton 1 ())
    fromList [1]
    

  3. toMap :: HashSet a -> HashMap a ()

    rio RIO.HashSet

    Convert to set to the equivalent HashMap with () values.

    >>> HashSet.toMap (HashSet.singleton 1)
    fromList [(1,())]
    

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

    rio RIO.List

    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]
    

  5. foldMapWithKey :: Monoid m => (k -> a -> m) -> Map k a -> m

    rio RIO.Map

    Fold the keys and values in the map using the given monoid, such that

    foldMapWithKey f = fold . mapWithKey f
    
    This can be an asymptotically faster than foldrWithKey or foldlWithKey for some monoids.

  6. isProperSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool

    rio RIO.Map

    Is this a proper submap? (ie. a submap but not equal). Defined as (isProperSubmapOf = isProperSubmapOfBy (==)).

  7. isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool

    rio RIO.Map

    Is this a proper submap? (ie. a submap but not equal). The expression (isProperSubmapOfBy f m1 m2) returns True when keys m1 and keys m2 are not equal, all keys in m1 are in m2, and when f returns True when applied to their respective values. For example, the following expressions are all True:

    isProperSubmapOfBy (==) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
    isProperSubmapOfBy (<=) (fromList [(1,1)]) (fromList [(1,1),(2,2)])
    
    But the following are all False:
    isProperSubmapOfBy (==) (fromList [(1,1),(2,2)]) (fromList [(1,1),(2,2)])
    isProperSubmapOfBy (==) (fromList [(1,1),(2,2)]) (fromList [(1,1)])
    isProperSubmapOfBy (<)  (fromList [(1,1)])       (fromList [(1,1),(2,2)])
    

  8. isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool

    rio RIO.Map

    This function is defined as (isSubmapOf = isSubmapOfBy (==)).

  9. isSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool

    rio RIO.Map

    The expression (isSubmapOfBy f t1 t2) returns True if all keys in t1 are in tree t2, and when f returns True when applied to their respective values. For example, the following expressions are all True:

    isSubmapOfBy (==) (fromList [('a',1)]) (fromList [('a',1),('b',2)])
    isSubmapOfBy (<=) (fromList [('a',1)]) (fromList [('a',1),('b',2)])
    isSubmapOfBy (==) (fromList [('a',1),('b',2)]) (fromList [('a',1),('b',2)])
    
    But the following are all False:
    isSubmapOfBy (==) (fromList [('a',2)]) (fromList [('a',1),('b',2)])
    isSubmapOfBy (<)  (fromList [('a',1)]) (fromList [('a',1),('b',2)])
    isSubmapOfBy (==) (fromList [('a',1),('b',2)]) (fromList [('a',1)])
    
    Note that isSubmapOfBy (_ _ -> True) m1 m2 tests whether all the keys in m1 are also keys in m2.

  10. biconcatMap :: Bifoldable t => (a -> [c]) -> (b -> [c]) -> t a b -> [c]

    rio RIO.Prelude

    Given a means of mapping the elements of a structure to lists, computes the concatenation of all such lists in order.

    Examples

    Basic usage:
    >>> biconcatMap (take 3) (fmap digitToInt) ([1..], "89")
    [1,2,3,8,9]
    
    >>> biconcatMap (take 3) (fmap digitToInt) (Left [1..])
    [1,2,3]
    
    >>> biconcatMap (take 3) (fmap digitToInt) (Right "89")
    [8,9]
    

Page 491 of many | Previous | Next