Hoogle Search

Within LTS Haskell 24.12 (ghc-9.10.3)

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

  1. lookupLE :: Key -> NEIntMap a -> Maybe (Key, a)

    nonempty-containers Data.IntMap.NonEmpty

    O(log n). 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')
    

  2. lookupLT :: Key -> NEIntMap a -> Maybe (Key, a)

    nonempty-containers Data.IntMap.NonEmpty

    O(log n). 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')
    

  3. lookupGE :: Key -> NEIntSet -> Maybe Key

    nonempty-containers Data.IntSet.NonEmpty

    O(log n). Find smallest element greater or equal to the given one.

    lookupLT 3 (fromList (3 :| [5])) == Just 3
    lookupLT 4 (fromList (3 :| [5])) == Just 5
    lookupLT 6 (fromList (3 :| [5])) == Nothing
    

  4. lookupGT :: Key -> NEIntSet -> Maybe Key

    nonempty-containers Data.IntSet.NonEmpty

    O(log n). Find smallest element greater than the given one.

    lookupLT 4 (fromList (3 :| [5])) == Just 5
    lookupLT 5 (fromList (3 :| [5])) == Nothing
    

  5. lookupLE :: Key -> NEIntSet -> Maybe Key

    nonempty-containers Data.IntSet.NonEmpty

    O(log n). Find largest element smaller or equal to the given one.

    lookupLT 2 (fromList (3 :| [5])) == Nothing
    lookupLT 4 (fromList (3 :| [5])) == Just 3
    lookupLT 5 (fromList (3 :| [5])) == Just 5
    

  6. lookupLT :: Key -> NEIntSet -> Maybe Key

    nonempty-containers Data.IntSet.NonEmpty

    O(log n). Find largest element smaller than the given one.

    lookupLT 3 (fromList (3 :| [5])) == Nothing
    lookupLT 5 (fromList (3 :| [5])) == Just 3
    

  7. lookupGE :: Ord k => k -> NEMap k a -> Maybe (k, a)

    nonempty-containers Data.Map.NonEmpty

    O(log n). 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
    

  8. lookupGT :: Ord k => k -> NEMap k a -> Maybe (k, a)

    nonempty-containers Data.Map.NonEmpty

    O(log n). 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
    

  9. lookupIndex :: Ord k => k -> NEMap k a -> Maybe Int

    nonempty-containers Data.Map.NonEmpty

    O(log n). 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
    

  10. lookupLE :: Ord k => k -> NEMap k a -> Maybe (k, a)

    nonempty-containers Data.Map.NonEmpty

    O(log n). 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')
    

Page 101 of many | Previous | Next