Hoogle Search

Within LTS Haskell 24.60 (ghc-9.10.3)

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

  1. fromListWithKey :: Hashable k => (k -> v -> v -> v) -> [(k, v)] -> HashMap k v

    unordered-containers Data.HashMap.Strict

    Construct a map from a list of elements. Uses the provided function to merge duplicate entries.

    Examples

    Given a list of key-value pairs where the keys are of different flavours, e.g:
    data Key = Div | Sub
    
    and the values need to be combined differently when there are duplicates, depending on the key:
    combine Div = div
    combine Sub = (-)
    
    then fromListWithKey can be used as follows:
    fromListWithKey combine [(Div, 2), (Div, 6), (Sub, 2), (Sub, 3)]
    = fromList [(Div, 3), (Sub, 1)]
    
    More generally, duplicate entries are accumulated as follows;
    fromListWith f [(k, a), (k, b), (k, c), (k, d)]
    = fromList [(k, f k d (f k c (f k b a)))]
    

  2. toList :: HashMap k v -> [(k, v)]

    unordered-containers Data.HashMap.Strict

    Return a list of this map's elements. The list is produced lazily. The order of its elements is unspecified, and it may change from version to version of either this package or of hashable.

  3. fromList :: Hashable a => [a] -> HashSet a

    unordered-containers Data.HashSet

    Construct a set from a list of elements.

  4. toList :: HashSet a -> [a]

    unordered-containers Data.HashSet

    Return a list of this set's elements. The list is produced lazily. The order of its elements is unspecified, and it may change from version to version of either this package or of hashable.

  5. fromList :: Hashable a => [a] -> HashSet a

    unordered-containers Data.HashSet.Internal

    Construct a set from a list of elements.

  6. toList :: HashSet a -> [a]

    unordered-containers Data.HashSet.Internal

    Return a list of this set's elements. The list is produced lazily. The order of its elements is unspecified, and it may change from version to version of either this package or of hashable.

  7. newListArray :: (MArray a e m, Ix i) => (i, i) -> [e] -> m (a i e)

    array Data.Array.Base

    Constructs a mutable array from a list of initial elements. The list gives the elements of the array in ascending order beginning with the lowest index. The first and second element of the tuple specifies the lowest and highest index, respectively.

  8. newListArray :: (MArray a e m, Ix i) => (i, i) -> [e] -> m (a i e)

    array Data.Array.MArray

    Constructs a mutable array from a list of initial elements. The list gives the elements of the array in ascending order beginning with the lowest index. The first and second element of the tuple specifies the lowest and highest index, respectively.

  9. newListArray :: (MArray a e m, Ix i) => (i, i) -> [e] -> m (a i e)

    array Data.Array.MArray.Safe

    Constructs a mutable array from a list of initial elements. The list gives the elements of the array in ascending order beginning with the lowest index. The first and second element of the tuple specifies the lowest and highest index, respectively.

  10. putList :: Binary t => [t] -> Put

    binary Data.Binary

    Encode a list of values in the Put monad. The default implementation may be overridden to be more efficient but must still have the same encoding format.

Page 52 of many | Previous | Next