Documentation

ImportGraph.Shake.Core

shake core types #

This file copies types and functions from Lake.CLI.Shake wholesale in order to make them public, with some modifications to Needs in order to suit our purposes (namely, we benefit from keeping track of private dependence in order to uniformly handle declarations from the same file, whereas shake can get away with handling import all specially.)

More utilities on these types are defined in ImportGraph.Shake.Basic.

Bitset #

This section is copied without modification, and should be removed if Shake API becomes public.

We use Nat as a bitset for doing efficient set operations. The bit indexes will usually be a module index.

Instances For
    Instances For
      @[instance_reducible]
      Instances For

        Needs and NeedsKind #

        This section is modified from shake's version to allow us to reason about import alls in the import hierarchy instead of dynamically.

        An "atomic" module dependency. Note that we consider an inclusion of the public scope and an inclusion of the private scope to be two separate dependencies. Modules may be related by multiple NeedsKinds; the presence of any NeedsKind implies some dependency between the modules.

        • isExported : Bool

          Represents public (meta)? import: an import of the public scope of the source into the public scope of the target. false means that the public scope of the source is instead imported into the private scope of the target.

        • isMeta : Bool

          Represents (public)? meta import (all)?: a lifting of non-meta declarations to the meta phase.

        • isAll : Bool

          Represents (meta)? import all: an import of the private scope into the private scope. false means the private scope of the source is not accessed.

        • not_isExported_and_isAll : ¬(self.isExported = true ∧ self.isAll = true)
        Instances For
          @[reducible, match_pattern, inline]
          Instances For
            @[reducible, match_pattern, inline]
            Instances For
              @[reducible, match_pattern, inline]
              Instances For
                @[reducible, match_pattern, inline]
                Instances For
                  @[reducible, match_pattern, inline]
                  Instances For
                    @[reducible, match_pattern, inline]
                    Instances For

                      Assumes that ¬(imp.isExported ∧ imp.importAll).

                      Instances For

                        An import effecting a NeedsKind.

                        Instances For

                          Logically, a map NeedsKind → Set <modules>.

                          Instances For
                            @[instance_reducible]
                            @[reducible, inline]

                            An abbreviation for Needs, but intended to express what is provided to a given scope. Notably, we expect this to be both transitively closed and linearized (i.e., to have also taken public ⊆ private into account) but do not enforce this for ease of building up Provides.

                            Instances For
                              @[inline]
                              Instances For
                                @[inline]
                                Instances For
                                  @[inline]
                                  Instances For
                                    Instances For
                                      Instances For
                                        Instances For
                                          @[instance_reducible]