Hi Philip,

On Fri, May 11, 2012 at 5:12 PM, "Philip K. F. Hölzenspies" <pkfh@st-andrews.ac.uk> wrote:

However, it turns out that this never leads to an evaluation of extTyNamesLoc. I've come as far as to see that, since "Located a" is a synonym for "GenLocated SrcSpan a", the type we're looking for really has a binary constructor, thus we should use ext2Q.

This made things work: We first modify the function we apply to Located things:


extTyNamesLoc :: (Data loc, Data a) => SrcSpan -> GenLocated loc a -> OccurrenceTable
extTyNamesLoc l (L l' x) = case cast l' of
Just l'' -> extTyNames l'' x
Nothing -> extTyNames l x

Do you really need this? Can't you use the definition of `extTyNamesLoc` shown previously, and redefine `extTyNames` to use `ext2Q`, as in:
 
extTyNames l x = (extTyNamesDef l x `mkQ` extTyNamesTy l `ext2Q` extTyNamesLoc l) x

?


Cheers,
Pedro