1 {-# LANGUAGE FlexibleInstances #-}
10 import Data.List.NonEmpty (NonEmpty(..))
12 import qualified Language.Symantic.XML as XML
15 -- | Absolute text file position.
16 type Pos = XML.FilePos
18 instance Semigroup Pos where
19 Pos lx cx <> Pos ly cy =
21 instance Monoid Pos where
36 type Cell = XML.Sourced Location
38 instance (FromPad a, Semigroup a, Monoid a) => Monoid (Cell a) where
44 cell0 = XML.Sourced (XML.FileRange "" filePos0 filePos0 :| [])
45 where filePos0 = XML.FilePos 0 0
48 type Span = XML.FileRange
51 type Location = XML.FileSource