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.

  1. lookupResponseHeader :: forall (h :: Symbol) a (headers :: [Type]) r . HasResponseHeader h a headers => Headers headers r -> ResponseHeader h a

    servant Servant.API

    Look up a specific ResponseHeader, without having to know what position it is in the HList.

    >>> let example1 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String
    
    >>> let example2 = addHeader True example1 :: Headers '[Header "1st" Bool, Header "someheader" Int] String
    
    >>> lookupResponseHeader example2 :: ResponseHeader "someheader" Int
    Header 5
    
    >>> lookupResponseHeader example2 :: ResponseHeader "1st" Bool
    Header True
    
    Usage of this function relies on an explicit type annotation of the header to be looked up. This can be done with type annotations on the result, or with an explicit type application. In this example, the type of header value is determined by the type-inference, we only specify the name of the header:
    >>> :set -XTypeApplications
    
    >>> case lookupResponseHeader @"1st" example2 of { Header b -> b ; _ -> False }
    True
    

  2. lookupResponseHeader :: forall (h :: Symbol) a (headers :: [Type]) r . HasResponseHeader h a headers => Headers headers r -> ResponseHeader h a

    servant Servant.API.ResponseHeaders

    Look up a specific ResponseHeader, without having to know what position it is in the HList.

    >>> let example1 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String
    
    >>> let example2 = addHeader True example1 :: Headers '[Header "1st" Bool, Header "someheader" Int] String
    
    >>> lookupResponseHeader example2 :: ResponseHeader "someheader" Int
    Header 5
    
    >>> lookupResponseHeader example2 :: ResponseHeader "1st" Bool
    Header True
    
    Usage of this function relies on an explicit type annotation of the header to be looked up. This can be done with type annotations on the result, or with an explicit type application. In this example, the type of header value is determined by the type-inference, we only specify the name of the header:
    >>> :set -XTypeApplications
    
    >>> case lookupResponseHeader @"1st" example2 of { Header b -> b ; _ -> False }
    True
    

  3. lookupAnchor :: AnchorName -> YamlParser (Maybe YamlValue)

    yaml Data.Yaml.Parser

    No documentation available.

  4. lookupComponent :: PackageDescription -> ComponentName -> Maybe Component

    Cabal Distribution.Simple.LocalBuildInfo

    No documentation available.

  5. lookupComponentId :: PackageIndex a -> ComponentId -> Maybe a

    Cabal Distribution.Simple.PackageIndex

    Does a lookup by component identifier. In the absence of Backpack, this is just a lookupUnitId.

  6. lookupDependency :: InstalledPackageIndex -> PackageName -> VersionRange -> [(Version, [InstalledPackageInfo])]

    Cabal Distribution.Simple.PackageIndex

    Does a lookup by source package name and a range of versions. We get back any number of versions of the specified package name, all satisfying the version range constraint. This does NOT work for internal dependencies, DO NOT use this function on those; use lookupInternalDependency instead. INVARIANT: List of eligible InstalledPackageInfo is non-empty.

  7. lookupInternalDependency :: InstalledPackageIndex -> PackageName -> VersionRange -> LibraryName -> [(Version, [InstalledPackageInfo])]

    Cabal Distribution.Simple.PackageIndex

    Does a lookup by source package name and a range of versions. We get back any number of versions of the specified package name, all satisfying the version range constraint. INVARIANT: List of eligible InstalledPackageInfo is non-empty.

  8. lookupPackageId :: PackageIndex a -> PackageId -> Maybe a

    Cabal Distribution.Simple.PackageIndex

    Convenient alias of lookupSourcePackageId, but assuming only one package per package ID.

  9. lookupPackageName :: PackageIndex a -> PackageName -> [(Version, [a])]

    Cabal Distribution.Simple.PackageIndex

    Does a lookup by source package name.

  10. lookupSourcePackageId :: PackageIndex a -> PackageId -> [a]

    Cabal Distribution.Simple.PackageIndex

    Does a lookup by source package id (name & version). There can be multiple installed packages with the same source PackageId but different UnitId. They are returned in order of preference, with the most preferred first.

Page 40 of many | Previous | Next