Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

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

  1. lookupMax :: Map k a -> Maybe (k, a)

    containers Data.Map.Internal

    The maximal key of the map. Returns Nothing if the map is empty.

    lookupMax (fromList [(5,"a"), (3,"b")]) == Just (5,"a")
    lookupMax empty = Nothing
    

  2. lookupMin :: Map k a -> Maybe (k, a)

    containers Data.Map.Internal

    The minimal key of the map. Returns Nothing if the map is empty.

    lookupMin (fromList [(5,"a"), (3,"b")]) == Just (3,"b")
    lookupMin empty = Nothing
    

  3. lookupGE :: Ord k => k -> Map k v -> Maybe (k, v)

    containers Data.Map.Lazy

    Find smallest key greater or equal to the given one and return the corresponding (key, value) pair.

    lookupGE 3 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a')
    lookupGE 4 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b')
    lookupGE 6 (fromList [(3,'a'), (5,'b')]) == Nothing
    

  4. lookupGT :: Ord k => k -> Map k v -> Maybe (k, v)

    containers Data.Map.Lazy

    Find smallest key greater than the given one and return the corresponding (key, value) pair.

    lookupGT 4 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b')
    lookupGT 5 (fromList [(3,'a'), (5,'b')]) == Nothing
    

  5. lookupIndex :: Ord k => k -> Map k a -> Maybe Int

    containers Data.Map.Lazy

    Lookup the index of a key, which is its zero-based index in the sequence sorted by keys. The index is a number from 0 up to, but not including, the size of the map.

    isJust (lookupIndex 2 (fromList [(5,"a"), (3,"b")]))   == False
    fromJust (lookupIndex 3 (fromList [(5,"a"), (3,"b")])) == 0
    fromJust (lookupIndex 5 (fromList [(5,"a"), (3,"b")])) == 1
    isJust (lookupIndex 6 (fromList [(5,"a"), (3,"b")]))   == False
    

  6. lookupLE :: Ord k => k -> Map k v -> Maybe (k, v)

    containers Data.Map.Lazy

    Find largest key smaller or equal to the given one and return the corresponding (key, value) pair.

    lookupLE 2 (fromList [(3,'a'), (5,'b')]) == Nothing
    lookupLE 4 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a')
    lookupLE 5 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b')
    

  7. lookupLT :: Ord k => k -> Map k v -> Maybe (k, v)

    containers Data.Map.Lazy

    Find largest key smaller than the given one and return the corresponding (key, value) pair.

    lookupLT 3 (fromList [(3,'a'), (5,'b')]) == Nothing
    lookupLT 4 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a')
    

  8. lookupMax :: Map k a -> Maybe (k, a)

    containers Data.Map.Lazy

    The maximal key of the map. Returns Nothing if the map is empty.

    lookupMax (fromList [(5,"a"), (3,"b")]) == Just (5,"a")
    lookupMax empty = Nothing
    

  9. lookupMin :: Map k a -> Maybe (k, a)

    containers Data.Map.Lazy

    The minimal key of the map. Returns Nothing if the map is empty.

    lookupMin (fromList [(5,"a"), (3,"b")]) == Just (3,"b")
    lookupMin empty = Nothing
    

  10. lookupGE :: Ord k => k -> Map k v -> Maybe (k, v)

    containers Data.Map.Strict

    Find smallest key greater or equal to the given one and return the corresponding (key, value) pair.

    lookupGE 3 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a')
    lookupGE 4 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b')
    lookupGE 6 (fromList [(3,'a'), (5,'b')]) == Nothing
    

Page 34 of many | Previous | Next