Packages: exposed, hidden, available (was: Packages and Modules)

Dimitry Golubovsky golubovsky at gmail.com
Wed Jul 5 11:20:59 EDT 2006


Simon Marlow wrote:
In fact, we can imagine three states that a package could be in:

   - exposed: the package's modules populate the global module namespace,
     explicit "from" imports may be used to resolve ambiguity

   - hidden: the package cannot be used at all

   - available: the package can be used only by an explicit "from"
     import (this is rather like a qualified import at the package
     level, and might be useful if you want to use a package with
     module names that overlap with local modules).
---------------------------------------------------------------------------------------------------------

I'd suggest the following sub-definition for "available" (other name
could be "transient"):

A package which is "available" is not "installed" at (immediately
known to) a particular developer's system, as opposed to "exposed" and
"hidden" which are "installed".

When a package/program is being built that requires a package which is
not installed, three options are available:

  - a package is located (on the Internet, using Cabal-get or
Cabalfind, or manual search), downloaded, and installed (i. e. becomes
known to the developer's system), and gets into "exposed" or "hidden"
category

  - a package is located, downloaded temporarily (i. e. cached) on the
developer's system*, used for a particular package that requires it
and discarded afterwards (or lives for some time in the cache).**

  - package cannot be found (Internet search fails)

============
* just due to the fact that existing OS's generally distinguish
between local and network resources. If we imagine some sort of "http
file system" or "darcs file system" that mount URLs/repos to local
file system entries then explicit downloading is not necessary. The
latter may be (or already is) implemented as user-level file systems
with recent Linux kernels.

** one might think about "lazy package resolution" i. e. only minimal
subset of packages like base, mtl, network, etc that generally come
with GHC/other compiler are installed on a developer's system, and the
rest of packages are transient/cached on demand.

-- 
Dimitry Golubovsky

Anywhere on the Web


More information about the Glasgow-haskell-users mailing list