What is module awareness? (the case of the type_check library)

In this article on the type_check library, the author points out the following problems with the current state of the code:

The first thing is that the full standard library needs to be given appropriate typing in a library, so that you don’t have to constantly run around typing everything. And in order to do this, type_check needs to be made module aware, which it currently is not. Module-awareness adds a good deal of complexity as well — how do we import types for instance?

Also, in the TODO section of the library, there are entries like:

  • add module awareness for predicates
  • add module awareness for types

As I’m not familiar with the inner working of the prolog module system, and I didn’t find information on the best practice for dealing with them, could you explain in more detail what’s the problem here, and how can I get more information on the topic?


You quote the two issues above :slight_smile: The module system is document and the libraries give plenty of examples. The tutorials menu of the website has a tutorial on modules. That all should be plenty to get a reasonable idea. In the end it is pretty simple: a predicate is addressed using a module, name and arity and modules can import and export predicates to/from other modules.

1 Like