1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Remove Lower instances for Span and Pos

This commit is contained in:
Rick Winfrey 2020-03-20 14:58:21 -07:00
parent d0fca24ef5
commit 78e94e37f7
2 changed files with 1 additions and 10 deletions

View File

@ -75,7 +75,7 @@ totalRange = Range 0 . B.length . bytes
-- | Return a 'Span' that covers the entire text.
totalSpan :: Source -> Span
totalSpan source = Span lowerBound (Pos (Prelude.length ranges) (succ (end lastRange - start lastRange))) where
totalSpan source = Span (Pos 1 1) (Pos (Prelude.length ranges) (succ (end lastRange - start lastRange))) where
ranges = lineRanges source
lastRange = fromMaybe lowerBound (getLast (foldMap (Last . Just) ranges))

View File

@ -18,7 +18,6 @@ import Control.DeepSeq (NFData)
import Data.Aeson ((.:), (.=))
import qualified Data.Aeson as A
import Data.Hashable (Hashable)
import Data.Semilattice.Lower (Lower (..))
import GHC.Generics (Generic)
import GHC.Stack (SrcLoc (..))
@ -46,10 +45,6 @@ instance A.FromJSON Span where
<$> o .: "start"
<*> o .: "end"
instance Lower Span where
lowerBound = Span lowerBound lowerBound
-- | Construct a Span with a given value for both its start and end positions.
point :: Pos -> Span
point p = Span p p
@ -83,10 +78,6 @@ instance A.FromJSON Pos where
[ line, col ] <- A.parseJSON arr
pure $ Pos line col
instance Lower Pos where
lowerBound = Pos 1 1
line_, column_ :: Lens' Pos Int
line_ = lens line (\p l -> p { line = l })
column_ = lens column (\p l -> p { column = l })