Thanks, Daniel. I&#39;m still stumped. When I say <br><br>#include &quot;B.hs&quot;<br><br>in a .hs file, all works fine, but when in a .lhs file I get &quot;error: B.hs: No such file or directory&quot;. The file B.hs is in the same directory as the including file, which is the current directory for ghci. Same situation with ghc.<br>

<br>If I change &quot;B.hs&quot; to &quot;./B.hs&quot;, I get the same behavior. Only if I use a fully qualified path name for B.hs does it get found from the .lhs file.<br><br>I&#39;m using GHC 6.12.3 on Mac OS 10.6.6.<br>

<br>Any ideas? (Anyone, not just Daniel.)<br><br>Thanks,  - Conal<br><br><br><div class="gmail_quote">On Thu, Feb 3, 2011 at 2:51 AM, Daniel Fischer <span dir="ltr">&lt;<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">On Thursday 03 February 2011 10:33:23, Conal Elliott wrote:<br>


&gt; Does anyone have a working example of #include&#39;ing Haskell code into a<br>
&gt; bird-tracks-style .lhs file with GHC? Every way I try leads to parsing<br>
&gt; errors. Is there documentation about how it&#39;s supposed to work?<br>
&gt;<br>
&gt; Help much appreciated.   - Conal<br>
<br>
</div></div>Stupid example:<br>
<br>
-- Main:<br>
<br>
&gt; {-# LANGUAGE CPP #-}<br>
&gt; module Main (main) where<br>
<br>
#include &quot;MachDeps.h&quot;<br>
<br>
&gt; main :: IO ()<br>
&gt; main = do<br>
<br>
#if WORD_SIZE_IN_BITS == 32<br>
<br>
&gt;     putStrLn &quot;32 bits&quot;<br>
<br>
#include &quot;Stuff32&quot;<br>
<br>
# else<br>
<br>
&gt;     putStrLn &quot;64 bits&quot;<br>
<br>
#include &quot;Stuff64&quot;<br>
#endif<br>
<br>
-- Stuff32:<br>
<br>
      putStrLn &quot;Included from Stuff32&quot;<br>
<br>
-- Stuff64:<br>
<br>
      putStrLn &quot;Included from Stuff64&quot;<br>
<br>
<br>
It&#39;s a bit tricky. Since the C preprocessor is run after the unlit, the<br>
included code should not have bird-tracks, also you have to get the<br>
indentation right. There&#39;s probably a way to run cpp before unlit, which<br>
would allow you to have bird-tracks in the #include&#39;d code.<br>
<br>
Much easier with LaTeX-style literate code.<br>
<br>
Cheers,<br>
<font color="#888888">Daniel<br>
</font></blockquote></div><br>