Is the Hackage dependency DAG a tree?

In other words, can a package not import base?


Edit:
Posted before finishing my coffee; a package can transitively import another package in multiple ways so it’s not a tree.

If we want to consider choice between possible versions, or based on flags, then the dependency structure of hackage is, order-theoretically speaking, not a partial ordering on packages, but a partial ordering between sets of packages, and specifically it can be expressed as an antimatroid, or a diamond-free semimodular lattice: [2302.05417] A Mathematical Model of Package Management Systems -- from General Event Structures to Antimatroids

2 Likes

no need to hate Nintendo platformers smh

1 Like

I suppose I had in mind a “fully-resolved” tree, once the choice between package versions is made by the tooling. Great that you’re finding some general algebraic underpinnings :slight_smile:

My concern was quite plainly one of visualization of a dependency graph, after seeing some pretty compelling chart types in D3.js

Ah, in that case, I don’t think a dependency on base is necessary strictly speaking, though its hard to imagine how one wouldn’t arise. The structure you get is, I think, going to be able to correspond to any DAG, and specifically will do so as the hasse diagram of a potentially arbitrary partial ordering.

1 Like