/usr/share/doc/happy/html/sec-happy-ghci.html is in happy 1.19.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>8.5. Using Happy with GHCi</title><link rel="stylesheet" type="text/css" href="fptools.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Happy User Guide"><link rel="up" href="sec-tips.html" title="Chapter 8. Tips"><link rel="prev" href="sec-conflict-tips.html" title="8.4. Conflict Tips"><link rel="next" href="ix01.html" title="Index"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.5. Using Happy with <span class="application">GHCi</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-conflict-tips.html">Prev</a> </td><th width="60%" align="center">Chapter 8. Tips</th><td width="20%" align="right"> <a accesskey="n" href="ix01.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec-happy-ghci"></a>8.5. Using Happy with <span class="application">GHCi</span></h2></div></div></div><a class="indexterm" name="idp58085456"></a><p><span class="application">GHCi</span>'s compilation manager
doesn't understand Happy grammars, but with some creative use of
macros and makefiles we can give the impression that
<span class="application">GHCi</span> is invoking Happy
automatically:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Create a simple makefile, called
<code class="filename">Makefile_happysrcs</code>:</p><pre class="programlisting">HAPPY = happy
HAPPY_OPTS =
all: MyParser.hs
%.hs: %.y
$(HAPPY) $(HAPPY_OPTS) $< -o $@</pre></li><li class="listitem"><p>Create a macro in GHCi to replace the
<code class="literal">:reload</code> command, like so (type this all
on one line):</p><pre class="screen">:def myreload (\_ -> System.system "make -f Makefile_happysrcs"
>>= \rr -> case rr of { System.ExitSuccess -> return ":reload" ;
_ -> return "" })</pre></li><li class="listitem"><p>Use <code class="literal">:myreload</code>
(<code class="literal">:my</code> will do) instead of
<code class="literal">:reload</code> (<code class="literal">:r</code>).</p></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-conflict-tips.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sec-tips.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ix01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.4. Conflict Tips </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Index</td></tr></table></div></body></html>
|