> > > {-# RULES
> > > "lookupFM.range check" forall m key . rdMap m key =
> > >  maybe (lookupFmError #LINE #FILE)
> > >        id
> > >        (#lookupFM m key)
> > > #-}  --  ^^^^^^^^
> [..]
> > Actually, when using cpp, the __LINE__ and __FILE__ macros 
> should expand to
> > the right thing (this is what GHC itself uses to generate 
> accurate locations
> > for assertion failures).
> 
> I think Marc wants the line number of the occurrence of rdMap to occur
> in the error message, not the line number of the definition of the
> rule "lookupFM.range check".

yes, I should have mentioned that you need to use a cpp macro to achieve the
desired effect.  eg. GHC's "ASSERT" macro:

   #define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else

Cheers,
        Simon

Reply via email to