curry.toolchain.flat2icurry.interfaces module
Finds and reads the FlatCurry interfaces of imported modules.
The Curry front end writes the interface M.fint of a module M beside
its M.fcy. Two layouts occur. The front end puts the files of the
hierarchical module A.B under <root>/.curry/<subdir>/A/B.fint, and
Sprite keeps per-directory products under <root>/A/.curry/<subdir>/B.fint.
The finder tries both. When no interface exists, the full .fcy serves,
because the translation uses only names, visibilities, and data types.
- class curry.toolchain.flat2icurry.interfaces.InterfaceFinder(searchdirs, subdirs, progs=())[source]
Bases:
objectLooks up the interface of a module by name.
- Parameters:
searchdirs – The directories to search, as a Curry path.
subdirs – The names of the subdirectories of
.currythat hold the front end output, e.g.,['pakcs-3.4.1'].progs – Programs already in hand, used before any file is read.
- curry.toolchain.flat2icurry.interfaces.load_interface(filename)[source]
Reads a FlatCurry file. Files are cached by name, size, and time.
- curry.toolchain.flat2icurry.interfaces.module_root(fcyfile, modname)[source]
The directory from which the module
modnamewas compiled, given its FlatCurry file. The file of moduleA.Blies at<root>/.curry/<subdir>/A/B.fcyor at<root>/A/.curry/<subdir>/B.fcy.
- curry.toolchain.flat2icurry.interfaces.product_path(filename)[source]
Splits the path of a front-end product into
(root, subdir, tail). The file lies at<root>/.curry/<subdir>/<tail>/M.ext;tailis empty for a module at the top level andA/Bfor a module underA.B. Returns None when no.currydirectory encloses the file.