module SourceMap.Types where
import Data.Int
import Data.Monoid
import Data.Text
import Data.Function
data SourceMapping = SourceMapping
{ smFile :: !FilePath
, smSourceRoot :: !(Maybe FilePath)
, smMappings :: ![Mapping]
} deriving Show
data Mapping = Mapping
{ mapGenerated :: !Pos
, mapOriginal :: !(Maybe Pos)
, mapSourceFile :: !(Maybe FilePath)
, mapName :: !(Maybe Text)
} deriving Show
data Pos = Pos
{ posLine :: !Int32
, posColumn :: !Int32
} deriving (Eq,Show)
instance Ord Pos where
compare a b =
on compare posLine a b <> on compare posColumn a b