Open
Description
There're a couple things in the way of having a proper Monoid
for SrcSpan
and SrcSpanInfo
:
- A good representation for empty. The existence of
noLoc = SrcLoc "" (-1) (-1)
sets a precedent for this representing an empty location / interval. - If
mergeSrcSpan
had a special case for empty, then it would be a proper definition formappend
.combSpanInfo
/(<++>)
throw awaysrcInfoPoints
, which isn't so nice. You could still have a propermappend
, though, if they preservedsrcInfoPoints
when combined withmempty
.
Maybe it would be better to have an explicit representation for empty SrcLoc
and SrcSpan
? Main issue is that it would be quite a breaking change.