On 1/17/08, <b class="gmail_sendername">Albert Y. C. Lai</b> &lt;<a href="mailto:trebla@vex.net">trebla@vex.net</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Magnus Therning wrote:<br>&gt; This might seem like a silly question, but what&#39;s the reasoning behind<br>&gt; the following behaviour?<br>&gt;<br>&gt; % ghc-pkg list dataenc<br>&gt; /usr/lib/ghc-6.8.2/package.conf:<br>
&gt; % ghc --make -hide-package dataenc -isrc UT.hs<br>&gt; ghc-6.8.2 : unknown package: dataenc<br>&gt;<br>&gt; Hiding an uninstalled package doesn&#39;t seem to warrant failing compilation!<br><br>&quot;I cannot find it, therefore I cannot hide it&quot;? XD
<br><br>The following is fairly widely accepted behaviour:<br><br>$ rm phd-thsies<br>rm: cannot remove `phd-thsies&#39;: No such file or directory<br><br>If a file is absent and you want it absent, is that an error?<br><br>
(Now you might get into a long thread debating whether deletion is<br>analogous to hiding...)<br><br>If I want to hide or delete something, and the computer can&#39;t find that<br>something, it may be because I have a typo. If the computer remains
<br>silent about it, I fail to hide or delete the true thing. I want to<br>delete phd-thesis, but I typed phd-thsies, and I appreciate the error<br>report. If I fail to delete phd-thesis, at worst more people read it and<br>
be enlightened :) but if I fail to hide a package and I don&#39;t know about<br>it, the ensuing problems will be much more mysterious.</blockquote><div><br>Fair enough.&nbsp; I stumbled on this behaviour because I was writing a makefile for my unit/quickcheck tests.&nbsp; I need to make sure that the correct module is used, hence I need to hide it if it&#39;s installed.&nbsp; I ended up with the following in order to work around the issue:
<br><br>ifeq (,$(shell ghc-pkg list dataenc | grep dataenc))<br>GHCOPTS = -fhpc -isrc<br>else<br>GHCOPTS = -fhpc -hide-package dataenc -isrc<br>endif<br><br>% : %.hs<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ghc --make $(GHCOPTS) $&lt;<br><br>Is there a better way to do it?
<br><br>/M<br></div></div>