happy, ghc and {# OPTIONS #} pragma

Martin Norbäck d95mback@dtek.chalmers.se
06 Jun 2003 17:23:39 +0200

I am trying to get an {-# OPTIONS #-} pragma to appear in my Happy
generated file, since I use warnings and want to disable them for this
file. I'm putting the pragma first in the module header section of my
Happy file.

My problem is that the generated file starts like this (the first pragma
is generated by Happy):

{-# OPTIONS -fglasgow-exts -cpp #-}
-- parser produced by Happy Version 1.13
{-# OPTIONS -fno-warn-unused-matches #-}

This means that GHC will only see the first one. Is there a way to make
Happy put the pragma above the comment, or not produce the comment at

Or is there a way to make GHC recognise the pragma even though it is
after a comment?



Martin Norbäck          d95mback@dtek.chalmers.se              
Kapplandsgatan 40       +46 (0)708 26 33 60                    
S-414 78  GÖTEBORG      http://www.dtek.chalmers.se/~d95mback/
SWEDEN                  OpenPGP ID: 3FA8580B