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.
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.
lookup :: Resolver -> Domain -> TYPE -> IO (Either DNSError [RData])dns Network.DNS.LookupRaw Look up resource records of a specified type for a domain, collecting the results from the ANSWER section of the response. See the documentation of lookupRaw to understand the concrete behavior. Cache is used if resolvCache is Just. Example:
>>> rs <- makeResolvSeed defaultResolvConf >>> withResolver rs $ \resolver -> lookup resolver "www.example.com" A Right [93.184.216.34]
lookup :: FieldName -> Data -> FieldName -> LookupFields -> BuildTransformSpecshvega Graphics.Vega.VegaLite Perform a lookup of named fields between two data sources. This allows you to find values in one data source based on the values in another (like a relational join). Use lookupSelection for linking data with interactive selections. See the Vega-Lite documentation for further details. The following would return the values in the age and height fields from lookup_people.csv for all rows where the value in the name column in that file matches the value of person in the primary data source.
peopleData = dataFromUrl "data/lookup_people.csv" [] lfields = LuFields ["age", "height"] trans = transform . lookup "person" peopleData "name" lfields
Note that the interface has changed in version 0.5.0.0: the output field names argument now uses the new LookupFields type. This provides greater flexibility in naming and default behaviour. The conversion from version 0.4 is simple: changelookup key1 dataSource key2 fields
tolookup key1 dataSource key2 (LuFields fields)
lookup :: Eq a => a -> [(a, b)] -> Maybe bmixed-types-num Numeric.MixedTypes.PreludeHiding lookup key assocs looks up a key in an association list. For the result to be Nothing, the list must be finite.
Examples
>>> lookup 2 [] Nothing
>>> lookup 2 [(1, "first")] Nothing
>>> lookup 2 [(1, "first"), (2, "second"), (3, "third")] Just "second"
lookup :: Hashable key => key -> Map key value -> STM (Maybe value)stm-containers StmContainers.Map Look up an item.