&gt; &gt;  I already export a partial parser for top-of-file pragmas,<br><div>&gt; </div><div>&gt; I see. What I don&#39;t see is how such a parser would return the &quot;rest of input&quot;.<br></div>
<div><br></div><div>Hmm. I see. And I see that you are correct in not seeing it, since it appears it cannot be done with Happy, which I believed. It would then be down to the parser/lexer to pass on unconsumed input, which seems a daunting and disruptive task, seeing how the lexer typically would tokenize some input in advance before the parser discovers that it cannot consume what has been lexed... Hmm.<br>
</div><div><br></div><div>I still find it a highly desirable feature, and at some point I would like to give it some further thought, to see if a way can be found. In the mean time, would you mind filing a feature request at <a href="http://trac.haskell.org/haskell-src-exts">http://trac.haskell.org/haskell-src-exts</a> ?</div>
<div><br></div><div>Cheers,</div><div><br></div><div>/Niklas</div>