The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V01. The language of Mathlib

Mathlib.Util.GetAllModules

2 declarations. Mathlib docs · Source

Utility functions for finding all .lean files or modules in a project.

TODO: getLeanLibs contains a hard-coded choice of which dependencies should be built and which ones should not. Could this be made more structural and robust, possibly with extra Lake support?

def getAllFiles E1 #

Bool → String → IO (Array System.FilePath)

getAllFiles git ml takes all .lean files in the directory ml (recursing into sub-directories) and returns the Array of Strings

#[file₁, ..., fileₙ]

of all their file names. These are not sorted in general.

The input git is a Boolean flag:

  • true means that the command uses git ls-files to find the relevant files;
  • false means that the command recursively scans all dirs searching for .lean files.

def getAllModulesSorted E1 #

Bool → String → IO (Array String)

Like getAllFiles, but return an array of module names instead, i.e. names of the form Mathlib/Algebra/Algebra/Basic.lean. In addition, these names are sorted in a platform-independent order.