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.
lookup :: Int -> MonoidalIntMap a -> Maybe amonoidal-containers Data.IntMap.Monoidal.Strict No documentation available.
lookup :: Ord k => k -> MonoidalMap k a -> Maybe amonoidal-containers Data.Map.Monoidal No documentation available.
lookup :: Ord k => k -> MonoidalMap k a -> Maybe amonoidal-containers Data.Map.Monoidal.Strict No documentation available.
lookup :: Ord k => k -> MultiMap k a -> [a]multimap Data.MultiMap O(log n). Lookup the value at a key in the map. The function will return the corrsponding values as a List, or the empty list if no values are associated witht the given key.
lookup :: Ord k => k -> SetMap k a -> Set amultimap Data.SetMap O(log n). Lookup the value at a key in the map. The function will return the corrsponding values as a List, or the empty list if no values are associated witht the given key.
lookup :: Key -> NEIntMap a -> Maybe anonempty-containers Data.IntMap.NonEmpty O(log n). Lookup the value at a key in the map. The function will return the corresponding value as (Just value), or Nothing if the key isn't in the map. An example of using lookup:
import Prelude hiding (lookup) import Data.Map.NonEmpty employeeDept = fromList (("John","Sales") :| [("Bob","IT")]) deptCountry = fromList (("IT","USA") :| [("Sales","France")]) countryCurrency = fromList (("USA", "Dollar") :| [("France", "Euro")]) employeeCurrency :: String -> Maybe String employeeCurrency name = do dept <- lookup name employeeDept country <- lookup dept deptCountry lookup country countryCurrency main = do putStrLn $ "John's currency: " ++ (show (employeeCurrency "John")) putStrLn $ "Pete's currency: " ++ (show (employeeCurrency "Pete"))The output of this program:John's currency: Just "Euro" Pete's currency: Nothing
lookup :: Ord k => k -> NEMap k a -> Maybe anonempty-containers Data.Map.NonEmpty O(log n). Lookup the value at a key in the map. The function will return the corresponding value as (Just value), or Nothing if the key isn't in the map. An example of using lookup:
import Prelude hiding (lookup) import Data.Map.NonEmpty employeeDept = fromList (("John","Sales") :| [("Bob","IT")]) deptCountry = fromList (("IT","USA") :| [("Sales","France")]) countryCurrency = fromList (("USA", "Dollar") :| [("France", "Euro")]) employeeCurrency :: String -> Maybe String employeeCurrency name = do dept <- lookup name employeeDept country <- lookup dept deptCountry lookup country countryCurrency main = do putStrLn $ "John's currency: " ++ (show (employeeCurrency "John")) putStrLn $ "Pete's currency: " ++ (show (employeeCurrency "Pete"))The output of this program:John's currency: Just "Euro" Pete's currency: Nothing
lookup :: Int -> NESeq a -> Maybe anonempty-containers Data.Sequence.NonEmpty The element at the specified position, counting from 0. If the specified position is negative or at least the length of the sequence, lookup returns Nothing. Unlike index, this can be used to retrieve an element without forcing it.
lookup :: Eq a => a -> [(a, b)] -> Maybe bprelude-compat Data.List2010 No documentation available.
lookup :: Eq a => a -> [(a, b)] -> Maybe bprelude-compat Prelude2010 No documentation available.