diff options
Diffstat (limited to 'compiler/basicTypes/SrcLoc.hs')
-rw-r--r-- | compiler/basicTypes/SrcLoc.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/basicTypes/SrcLoc.hs b/compiler/basicTypes/SrcLoc.hs index 696395f82f..bcf2fcbd6e 100644 --- a/compiler/basicTypes/SrcLoc.hs +++ b/compiler/basicTypes/SrcLoc.hs @@ -77,6 +77,9 @@ module SrcLoc ( getLoc, unLoc, unRealSrcSpan, getRealSrcSpan, + -- ** Modifying Located + mapLoc, + -- ** Combining and comparing Located values eqLocated, cmpLocated, combineLocs, addCLoc, leftmost_smallest, leftmost_largest, rightmost, @@ -527,6 +530,9 @@ data GenLocated l e = L l e type Located = GenLocated SrcSpan type RealLocated = GenLocated RealSrcSpan +mapLoc :: (a -> b) -> GenLocated l a -> GenLocated l b +mapLoc = fmap + unLoc :: HasSrcSpan a => a -> SrcSpanLess a unLoc (dL->L _ e) = e |