1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

No SplitDiff!

This commit is contained in:
Timothy Clem 2018-09-27 13:04:51 -05:00
parent 2d1a8cc7e7
commit 6b40e59c1d
2 changed files with 0 additions and 25 deletions

View File

@ -109,7 +109,6 @@ library
, Data.Scientific.Exts
, Data.Source
, Data.Span
, Data.SplitDiff
-- À la carte syntax types
, Data.Syntax
, Data.Syntax.Comment

View File

@ -1,24 +0,0 @@
module Data.SplitDiff
( SplitPatch (..)
, getRange
) where
import Control.Monad.Free
import Data.Location
import Data.Term
-- | A patch to only one side of a diff.
data SplitPatch a
= SplitInsert { splitTerm :: a }
| SplitDelete { splitTerm :: a }
| SplitReplace { splitTerm :: a }
deriving (Foldable, Eq, Functor, Show, Traversable)
-- | Get the range of a SplitDiff.
getRange :: SplitDiff f Location -> Range
getRange diff = locationByteRange $ case diff of
Free annotated -> termFAnnotation annotated
Pure patch -> termAnnotation (splitTerm patch)
-- | A diff with only one sides annotations.
type SplitDiff syntax ann = Free (TermF syntax ann) (SplitPatch (Term syntax ann))