mirror of
https://github.com/github/semantic.git
synced 2025-01-06 23:46:21 +03:00
Add a Semigroup instance over Source.
This commit is contained in:
parent
38d6bbe644
commit
d260ea19c9
@ -100,6 +100,9 @@ sourceSpanToRange source SourceSpan{..} = Range start end
|
||||
sumLengths = sum . fmap (\ Range{..} -> end - start)
|
||||
|
||||
|
||||
instance Semigroup (Source a) where
|
||||
Source a <> Source b = Source (a Vector.++ b)
|
||||
|
||||
instance Monoid (Source a) where
|
||||
mempty = fromList []
|
||||
mappend = (Source .) . (Vector.++) `on` getVector
|
||||
mappend = (<>)
|
||||
|
Loading…
Reference in New Issue
Block a user