{-# LANGUAGE RecordWildCards #-}
module GHC.SrcLoc
( SrcLoc
, srcLocPackage
, srcLocModule
, srcLocFile
, srcLocStartLine
, srcLocStartCol
, srcLocEndLine
, srcLocEndCol
, showSrcLoc
) where
data SrcLoc = SrcLoc
{ srcLocPackage :: String
, srcLocModule :: String
, srcLocFile :: String
, srcLocStartLine :: Int
, srcLocStartCol :: Int
, srcLocEndLine :: Int
, srcLocEndCol :: Int
} deriving (Show, Eq)
showSrcLoc :: SrcLoc -> String
showSrcLoc SrcLoc {..}
= concat [ srcLocFile, ":"
, show srcLocStartLine, ":"
, show srcLocStartCol, " in "
, srcLocPackage, ":", srcLocModule
]