[Template-haskell] RE: Declaration reordering

Simon Peyton-Jones simonpj@microsoft.com
Wed, 19 Feb 2003 15:26:53 -0000


| I've had a quick look and I think something called by one or both of
| "tcMonoExpr (HsBracket brack loc) aes_ty" and "tcBracket"? Oh, but the
| former calls the latter, so probably somewhere in tcTopSrcDecls? I'll
| try following this through if so.

deSugar/DsMeta.lhs, line 156 or thereabouts, is where a declaration
bracket gets turned into data structure.  Instead of=20
	return (val_ds ++ catMaybes tycl_ds ++ inst_ds)

you want
	return (sortByLoc (...the same thing...))

where sortByLoc does the sorting by source location. =20

Have fun!  Actually it should be really easy.

Simon