[Haskell-cafe] Bug in SYB, SYB-documentation or GHC-API (or I messed up somewhere)

José Pedro Magalhães jpm at cs.uu.nl
Sun May 13 21:29:12 CEST 2012


Hi Philip,

On Fri, May 11, 2012 at 5:12 PM, "Philip K. F. Hölzenspies" <
pkfh at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120513/af042f9c/attachment.htm>


More information about the Haskell-Cafe mailing list