Hoogle Search

Within LTS Haskell 24.65 (ghc-9.10.3)

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

  1. splitLookup :: Ord k => k -> NEMap k a -> These a (These (NEMap k a) (NEMap k a))

    nonempty-containers Data.Map.NonEmpty

    O(log n). The expression (splitLookup k map) splits a map just like split but also returns lookup k map, as the first field in the These:

    splitLookup 2 (fromList ((5,"a") :| [(3,"b")])) == That      (That  (fromList ((3,"b") :| [(5,"a")])))
    splitLookup 3 (fromList ((5,"a") :| [(3,"b")])) == These "b" (That  (singleton 5 "a"))
    splitLookup 4 (fromList ((5,"a") :| [(3,"b")])) == That      (These (singleton 3 "b") (singleton 5 "a"))
    splitLookup 5 (fromList ((5,"a") :| [(3,"b")])) == These "a" (This  (singleton 3 "b"))
    splitLookup 6 (fromList ((5,"a") :| [(3,"b")])) == That      (This  (fromList ((3,"b") :| [(5,"a")])))
    splitLookup 5 (singleton 5 "a")                 == This  "a"
    

  2. updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> NEMap k a -> (Maybe a, Map k a)

    nonempty-containers Data.Map.NonEmpty

    O(log n). Lookup and update. See also updateWithKey. The function returns changed value, if it is updated. Returns the original key value if the map entry is deleted. Returns a potentially empty map (Map) in the case that we delete the final key of a singleton map.

    let f k x = if x == "a" then Just ((show k) ++ ":new a") else Nothing
    updateLookupWithKey f 5 (fromList ((5,"a") :| [(3,"b")])) == (Just "5:new a", Data.Map.fromList ((3, "b") :| [(5, "5:new a")]))
    updateLookupWithKey f 7 (fromList ((5,"a") :| [(3,"b")])) == (Nothing,  Data.Map.fromList ((3, "b") :| [(5, "a")]))
    updateLookupWithKey f 3 (fromList ((5,"a") :| [(3,"b")])) == (Just "b", Data.Map.singleton 5 "a")
    

  3. enumLookup :: (MonadIO m, Enum c) => c -> EnumMap c -> m [Entity]

    apecs Apecs.Experimental.Reactive

    No documentation available.

  4. ixLookup :: (MonadIO m, Ix c) => c -> IxMap c -> m [Entity]

    apecs Apecs.Experimental.Reactive

    No documentation available.

  5. ordLookup :: (MonadIO m, Ord c) => c -> OrdMap c -> m [Entity]

    apecs Apecs.Experimental.Reactive

    No documentation available.

  6. splitLookupEQ :: Int -> PrimeIntSet -> (PrimeIntSet, Maybe (Prime Int), PrimeIntSet)

    arithmoi Math.NumberTheory.Primes.IntSet

    Simultaneous split and lookupEQ.

  7. elookup :: (Ord k, Show k, HasCallStack) => k -> Map k v -> v

    dejafu Test.DejaFu.Internal

    lookup but which errors if the key is not present. Use this only where it shouldn't fail!

  8. InvalidAXFRLookup :: DNSError

    dns Network.DNS.Types

    A zone tranfer, i.e., a request of type AXFR, was attempted with the "lookup" interface. Zone transfer is different enough from "normal" requests that it requires a different interface.

  9. confLookup :: SectionName -> Conf -> [Arg]

    hledger Hledger.Cli.Conf

    Fetch all the arguments/options defined in a section with this name, if it exists. This should be "general" for the unnamed first section, or a hledger command name.

  10. choroplethLookupFromGeo :: VegaLite

    hvega Graphics.Vega.Tutorials.VegaLite

    If we want to plot more than one map from the same table of data we need to do the lookup in the other order, using lookup to add the geographic data to the data table. Charting this way requires specifiying a few things differently than in the previous choropleth example (choroplethLookupToGeo):

    • We're using LuAs in lookup, rather than LuFields, which lets us use all the fields (columns) in the source rather than a specified subset.
    • We use a different set of geographic features (state rather than county outlines) from usGeoData.
    • The plot is defined as a specification, but does not directly refer to the value being displayed. This is set "externally" with the call to repeat. Since we have just had an example with RowFields, this time we use ColumnFields to stack the maps horizontally.
    • Since the different fields have vastly-different ranges (a maximum of roughly 0.01 for "engineers" whereas the "population" field is a billion times larger), the color scaling is set to vary per field with resolve.
    Open this visualization in the Vega Editor
    let popEngHurrData = dataFromUrl "https://raw.githubusercontent.com/vega/vega/master/docs/data/population_engineers_hurricanes.csv" []
    
    plotWidth = 300
    
    viz = [ popEngHurrData
    , width plotWidth
    , transform
    . lookup "id" (usGeoData "states") "id" (LuAs "geo")
    $ []
    , projection [PrType AlbersUsa]
    , encoding
    . shape [MName "geo", MmType GeoFeature]
    . color [MRepeat Column, MmType Quantitative, MLegend [LOrient LOTop, LGradientLength plotWidth]]
    $ []
    , mark Geoshape [MStroke "black", MStrokeOpacity 0.2]
    ]
    
    in toVegaLite
    [ specification $ asSpec viz
    , resolve
    . resolution (RScale [(ChColor, Independent)])
    $ []
    , repeat [ColumnFields ["population", "engineers", "hurricanes"]]
    ]
    
    By moving the legend to the top of each visualization, I have taken advantage of the fixed with (here 300 pixels) to ensure the color bar uses the full width (with LGradientLength).

Page 208 of many | Previous | Next