From ed140c99370b66a6fe5fc862358d0262cd0121a5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sat, 24 Jun 2017 10:59:09 -0400 Subject: [PATCH] :fire: Spans. --- src/Data/Span.hs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/Data/Span.hs b/src/Data/Span.hs index d6a041c64..4b8319f55 100644 --- a/src/Data/Span.hs +++ b/src/Data/Span.hs @@ -8,7 +8,6 @@ module Data.Span where import Data.Aeson ((.=), (.:)) import qualified Data.Aeson as A import Data.Semigroup -import Data.These import Prologue import Test.LeanCheck @@ -52,20 +51,6 @@ instance A.FromJSON Span where o .: "start" <*> o .: "end" - -newtype Spans = Spans { unSpans :: These Span Span } - deriving (Eq, Show) - -instance A.ToJSON Spans where - toJSON (Spans spans) = case spans of - (This span) -> A.object ["delete" .= span] - (That span) -> A.object ["insert" .= span] - (These span1 span2) -> A.object ["replace" .= (span1, span2)] - toEncoding (Spans spans) = case spans of - (This span) -> A.pairs $ "delete" .= span - (That span) -> A.pairs $ "insert" .= span - (These span1 span2) -> A.pairs $ "replace" .= (span1, span2) - instance Listable Pos where tiers = cons2 Pos