# Is there a way to have an unreferenced module in functor definition without the warning?

**URL:** <https://discuss.ocaml.org/t/is-there-a-way-to-have-an-unreferenced-module-in-functor-definition-without-the-warning/14399>\
**Category:** Learning\
**Tags:** functor\
**Created:** [April 1, 2024, 10:05am UTC](https://discuss.ocaml.org/t/is-there-a-way-to-have-an-unreferenced-module-in-functor-definition-without-the-warning/14399 "2024-04-01T10:05:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyocum](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cyocum](https://discuss.ocaml.org/u/cyocum)\
**Post date:** [April 1, 2024, 10:05am UTC](https://discuss.ocaml.org/t/is-there-a-way-to-have-an-unreferenced-module-in-functor-definition-without-the-warning/14399/1 "2024-04-01T10:05:36Z")

</div>

Hello,

I am writing a library at the moment where I am attempting to use functors to refactor some code to make it more flexible and easier to use before I think about possibly releasing it. I have a question about how functors work because there seems to be a gap in my knowledge.

I have a `Make` functor which uses an injected module where some types and functions will be defined by the user of the output of the `Make` functor. The injected module is only needed for the `Make` functor to use the functions and types internally to itself. There is no need for the injected module to appear in the public signature of the module that is output by `Make`. When I attempt do this in the `Make` module signature, I get an `unused functor` warning (specifically, `Error (warning 67 [unused-functor-parameter]): unused functor parameter.`). I know I can just ignore the warning but I was wondering if there might be a better way to handle this situation?

I have some cut down example code if anyone needs to see some code.

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![jjb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jjb/32/2713_2.png) [@jjb](https://discuss.ocaml.org/u/jjb)\
**Post date:** [April 1, 2024, 10:37am UTC](https://discuss.ocaml.org/t/is-there-a-way-to-have-an-unreferenced-module-in-functor-definition-without-the-warning/14399/2 "2024-04-01T10:37:56Z")

</div>

Try using an underscore `_` as the name of the argument module in the functor signature.

---

<div class="post-metadata">

**Author:** ![cyocum](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cyocum](https://discuss.ocaml.org/u/cyocum)\
**Post date:** [April 1, 2024, 10:42am UTC](https://discuss.ocaml.org/t/is-there-a-way-to-have-an-unreferenced-module-in-functor-definition-without-the-warning/14399/3 "2024-04-01T10:42:19Z")

</div>

That worked! Thank you!

Just for anyone else who stumbles on this, you need to do something like this:

```auto
module Make(_ : Injected.S) :
sig
     val some_func : string -> int
end

```

---

<div class="post-metadata">

**Author:** ![nojb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nojb/32/519_2.png) [@nojb](https://discuss.ocaml.org/u/nojb)\
**Post date:** [April 1, 2024, 11:29am UTC](https://discuss.ocaml.org/t/is-there-a-way-to-have-an-unreferenced-module-in-functor-definition-without-the-warning/14399/4 "2024-04-01T11:29:46Z")

</div>

> [@cyocum](#):
>
> you need to do something like this:

FYI, you can even have:

```auto
module Make : Injected.S ->
sig
     val some_func : string -> int
end

```

Cheers,  
Nicolas
