Hoogle Search
Within LTS Haskell 24.26 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
optics-core Optics.Fold The lookupOf function takes a Fold, a key, and a structure containing key/value pairs. It returns the first value corresponding to the given key. This function generalizes lookup to work on an arbitrary Fold instead of lists.
>>> lookupOf folded 4 [(2, 'a'), (4, 'b'), (4, 'c')] Just 'b'
>>> lookupOf folded 2 [(2, 'a'), (4, 'b'), (4, 'c')] Just 'a'
lookupEntity :: String -> Maybe Stringtagsoup Text.HTML.TagSoup.Entity Lookup an entity, using lookupNumericEntity if it starts with # and lookupNamedEntity otherwise
lookupNamedEntity :: String -> Maybe Stringtagsoup Text.HTML.TagSoup.Entity Lookup a named entity, using htmlEntities
lookupNamedEntity "amp" == Just "&" lookupNamedEntity "haskell" == Nothing
lookupNumericEntity :: String -> Maybe Stringtagsoup Text.HTML.TagSoup.Entity Lookup a numeric entity, the leading '#' must have already been removed.
lookupNumericEntity "65" == Just "A" lookupNumericEntity "x41" == Just "A" lookupNumericEntity "x4E" === Just "N" lookupNumericEntity "x4e" === Just "N" lookupNumericEntity "X4e" === Just "N" lookupNumericEntity "Haskell" == Nothing lookupNumericEntity "" == Nothing lookupNumericEntity "89439085908539082" == Nothing
lookupKey :: Key -> KeyMap v -> Maybe vautodocodec Autodocodec.Aeson.Compat No documentation available.
lookupDefault :: (Eq k, Hashable k) => v -> k -> HashMap k v -> vrio RIO.HashMap Return the value to which the specified key is mapped, or the default value if this map contains no mapping for the key. DEPRECATED: lookupDefault is deprecated as of version 0.2.11, replaced by findWithDefault.
lookupGE :: Ord k => k -> Map k v -> Maybe (k, v)rio RIO.Map 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
lookupGT :: Ord k => k -> Map k v -> Maybe (k, v)rio RIO.Map 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
lookupIndex :: Ord k => k -> Map k a -> Maybe Intrio RIO.Map 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
lookupLE :: Ord k => k -> Map k v -> Maybe (k, v)rio RIO.Map 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')