hawk
hawk copied to clipboard
Derive Language.Haskell.Exts.Location
haskell-src-exts keeps adding constructors and arguments to its core datatypes. This constantly causes Hawk's Language.Haskell.Exts.Location module to break, as we list each constructor in order to extract location information. Worse: each time we update the code to be compatible with the latest version of haskell-src-exts, we lose compatibility with the older versions, which might have unintended compatibility issues with older versions of other packages.
I just noticed that haskell-src-exts has Generic and Typeable instances for all of its datatypes, which means we should be able to generically extract the fields which happen to have type SrcLoc. This way, Hawk's code would be independent of the details of the constructors in haskell-src-exts!