Looking Up Symbols (hypha lookup)
hypha lookup is the single entry point for the question "which
package/module provides this?" It runs a three-tier short-circuit cascade
and returns at the first hit:
-
PackageCache(SQLite): exact-name + qualified-name lookup — e.g. bothlookupandData.Map.lookup. Indexes top-level declarations, class methods, data constructors and record fields alike. What it does not cover is a module that will not parse even after preprocessing: such a module contributes no rows, so a symbol only that module presents falls through to the tiers below — see Troubleshooting. Tier 1 is also empty for one background pass after an index-format upgrade — see Caching.This tier is pinned to your build plan. The SQLite cache is keyed on
(package, version)and shared by every project on the host, so it accumulates versions no single project builds against. Tier 1 answers only at the versions yourplan.jsonpins — or that--package-overridesets — and every provider reports the version it came from. Outside a cabal project there is no plan to pin to and the whole cache answers instead; hypha says so on stderr. -
Local Hoogle DB at
<project>/.hypha/hoogle.hoo: built lazily from scavenged store*.txtfiles plus on-demandhaddock --hooglefor local packages. Handles type-signature queries such asa -> Maybe a. -
Remote Hoogle at
hoogle.haskell.org: HTTP fallback. Cached in the globalkvtable; under--offlinea cached answer is still served, only the network call is skipped. Its request timeout is 10s, raisable with--hoogle-timeout SECONDS.This is the only tier that reaches beyond your build plan, and it is how you find a package you do not yet depend on. The
tierfield on each provider is what tells you how far an answer had to reach:cacheandlocal-hoogleare your project,remote-hoogleis all of Hackage.
hypha lookup lookup
hypha lookup 'a -> Maybe a'
hypha lookup always emits a structured envelope. Failures carry a code
(NOT_FOUND, HOOGLE_OFFLINE, HOOGLE_REMOTE_ERROR) and an actions map
suggesting how to retry. See Exit Codes for how those map
to process exit status.