<div class="gmail_quote">On Mon, May 11, 2009 at 10:25 AM, Neil Mitchell <span dir="ltr">&lt;<a href="mailto:ndmitchell@gmail.com">ndmitchell@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Peter,<br>
<div class="im"><br>
&gt; I would like to use the Hoogle text format in C#.<br>
<br>
</div>Out of curiosity, why? I&#39;m just interested to know what work you&#39;re doing.</blockquote><div><br></div><div>Sure. We&#39;re building with a graphical representation of a Haskellish language (a tiny subset of Haskell actually). The target audience is graphical artists and designers. For testing, I would like to populate the library with primitives taken from the Haskell base libraries.  I tried using the GHC API for it, but got stuck. I got the advice in #haskell to parse the Hoogle format, which indeed looks simple enough for the task.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">&gt; Hoogle on Hackage comes with a bunch of binary *.hoo files. Can these be<br>
&gt; converted to text/xml? If not, is the binary format documented?<br>
<br>
</div>The binary format is documented in the code, and there is a show command. Try:<br>
<br>
hoogle +base --dump<br>
<br>
However the binary format is not an encoding of the text format, it<br>
throws away lots of data, and precomputes interesting tables etc. If<br>
you want the original, the binary is probably not that useful.<br>
<br>
I do have a complete set of text files though. I can upload them to<br>
the Hoogle website, or I can distribute them with the hackage package.<br>
I could just email them to you privately. What seems the best option<br>
for everyone?</blockquote><div><br></div><div>I&#39;m not everyone but I guess it would be useful in general. From within Haskell, ideally one would just use the GHC API (or Cabal API) to extract all information I guess, but for usage in other languages, an easy to parse format is better no? (maybe even XML, but that is bulky :-) </div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">&gt; I know I can build hoo files using &quot;cabal haddock --hoogle&quot;. But doing this<br>

&gt; on the BASE package (which I need) from Hackage fails (I&#39;m on Windows, using<br>
&gt; MSYS):<br>
&gt; configure: creating ./config.status<br>
&gt; config.status: error: cannot find input file: include/<a href="http://HsBaseConfig.h.in" target="_blank">HsBaseConfig.h.in</a><br>
&gt; Does anyone have an easy solution? Maybe I just need to switch to Linux to<br>
&gt; get this working? :-)<br>
<br>
</div>I have a small pile of hacks to get the base library building with<br>
Hoogle. You are welcome to look at them (data/generate in the Hoogle<br>
repo). Caution: these hacks may make your eyes bleed, and certainly<br>
won&#39;t work for anything but the GHC/base version pair that I last did<br>
it on.<br>
<br>
Thanks<br>
<font color="#888888"><br>
Neil<br>
</font></blockquote></div><br>