# What is module awareness? (the case of the type\_check library)

**URL:** <https://swi-prolog.discourse.group/t/what-is-module-awareness-the-case-of-the-type-check-library/2503>\
**Category:** Help!\
**Created:** [June 11, 2020, 10:35pm UTC](https://swi-prolog.discourse.group/t/what-is-module-awareness-the-case-of-the-type-check-library/2503 "2020-06-11T22:35:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![meditans](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/meditans/32/1768_2.png) [@meditans](https://swi-prolog.discourse.group/u/meditans)\
**Post date:** [June 11, 2020, 10:35pm UTC](https://swi-prolog.discourse.group/t/what-is-module-awareness-the-case-of-the-type-check-library/2503/1 "2020-06-11T22:35:06Z")

</div>

In [this article on the type\_check library](https://medium.com/terminusdb/type-and-mode-checking-in-prolog-part-1-type-check-b0e7975dc80b), 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?

Thanks!

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [June 13, 2020, 1:16pm UTC](https://swi-prolog.discourse.group/t/what-is-module-awareness-the-case-of-the-type-check-library/2503/2 "2020-06-13T13:16:46Z")

</div>

> [@meditans](#):
>
> what’s the problem here

You quote the two issues above 🙂 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.
