- rGHC Glasgow Haskell Compiler
No Unit Test Coverage
- Build Status
Buildable 21769 Build 49845: [GHC] Linux/amd64: Continuous Integration Build 49844: [GHC] OSX/amd64: Continuous Integration Build 49843: [GHC] Windows/amd64: Continuous Integration Build 49842: arc lint + arc unit
Some initial comments.
I wonder if it would not be better to call it getLoc instead of getSrcSpan. Then the NamedThing function could keep its name. And it opens the door to different ways of storing the location in future, if needed.
This would also do away with the need for setRealSrcSpan.
Would it not be more natural to define these as
composeSrcSpan :: SrcSpan,(SrcSpanLess a ) -> a decomposeSrcSpan :: a -> (SrcSpan,SrcSpanLess a )
This ties up closer to the existing usage of Located. and would make things like dL simpler, being just
dL :: HasSrcSpan a => a -> (SrcSpan , SrcSpanLess a) dL e = decomposeSrcSpan e -- instead of dL :: HasSrcSpan a => a -> (SrcSpan , SrcSpanLess a) dL e = let (x , y) = decomposeSrcSpan e in (y , x)