mirror of
https://github.com/github/semantic.git
synced 2025-01-02 20:41:38 +03:00
Customize the Show instance for Pos for brevity.
This commit is contained in:
parent
f8c12cb213
commit
65d2fb968c
@ -22,7 +22,7 @@ data Pos = Pos
|
||||
{ posLine :: !Int
|
||||
, posColumn :: !Int
|
||||
}
|
||||
deriving (Show, Eq, Ord)
|
||||
deriving (Eq, Ord)
|
||||
|
||||
instance A.ToJSON Pos where
|
||||
toJSON Pos{..} =
|
||||
@ -33,6 +33,10 @@ instance A.FromJSON Pos where
|
||||
[line, col] <- A.parseJSON arr
|
||||
pure $ Pos line col
|
||||
|
||||
instance Show Pos where
|
||||
showsPrec d Pos{..} = showsBinaryWith showsPrec showsPrec "Pos" d posLine posColumn
|
||||
|
||||
|
||||
data Span = Span
|
||||
{ spanStart :: Pos
|
||||
, spanEnd :: Pos
|
||||
|
Loading…
Reference in New Issue
Block a user