<div><div dir="auto">FWIW, You could use hpack (package.yaml) to automatically fill exposed-module:</div><div dir="auto"><br></div><div dir="auto"><div><a href="https://github.com/sol/hpack" target="_blank">https://github.com/sol/hpack</a></div><br></div><div dir="auto">In short, hpack is a YAML-encoded cabal format with some syntax sugars and automatic module list generation.</div><div dir="auto">Downside is that if you're using cabal-install as the package manager, you should convert hpack to cabal each time you edit package.yaml or add new modules (you could set up editor save hook and/or git pre-commit hook to reduce such burden, though).</div><div dir="auto">If you're using stack, however, stack will automatically generate .cabal from package.yaml whenever it's needed, as hpack is integrated into stack.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2022年9月16日(金) 18:34 Volker Wysk <<a href="mailto:post@volker-wysk.de" target="_blank">post@volker-wysk.de</a>>:<br></div></div></div></div><div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Am Freitag, dem 16.09.2022 um 10:23 +0100 schrieb Tom Ellis:<br>
> On Fri, Sep 16, 2022 at 10:47:47AM +0200, Volker Wysk wrote:<br>
> > The cabal user guide says (in section 6.2.12): "Every module in the package<br>
> > must be listed in one of other-modules, library:exposed-modules or<br>
> > executable:main-is fields."<br>
> > <br>
> > However, I only get a warning message, when I comment out the other-modules<br>
> > field in my .cabal file. The program compiles. This is the message:<br>
> > <br>
> > <no location info>: warning: [-Wmissing-home-modules]<br>
> >     These modules are needed for compilation but not listed in your .cabal <br>
> >     file's other-modules: <br>
> >         Hsskripte Sicherung SicherungAktionen Text Wahl Zeit<br>
> > <br>
> > Is it really necessary to specify all the imported modules? If so, why does<br>
> > the program compile? Can that warning message be turned off?<br>
> <br>
> In response to all the sibling replies at once, is there a good reason<br>
> for this behaviour?  Succeeding but then failing later with obscure<br>
> errors (once the original warning message is nowhere to be seen) seems<br>
> like the worst of all worlds.  Suppose cabal errored here and failed<br>
> to proceed.  What would be the downside of that (besides backward<br>
> incompatibility)?<br>
<br>
I've already changed my mind. It's a little bothersome to manually add all<br>
the modules, which could be determined automatically. But it's better than<br>
having linker errors later.<br>
<br>
Regards,<br>
Volker<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div>
</div>