mirror of
https://github.com/github/semantic.git
synced 2024-12-01 09:15:01 +03:00
🔥 Cost.
This commit is contained in:
parent
d288ec1d17
commit
04b929822e
10
src/Info.hs
10
src/Info.hs
@ -6,7 +6,6 @@ module Info
|
||||
, Category(..)
|
||||
, category
|
||||
, setCategory
|
||||
, Cost(..)
|
||||
, SourceSpan(..)
|
||||
, SourcePos(..)
|
||||
, SourceSpans(..)
|
||||
@ -16,7 +15,6 @@ module Info
|
||||
, sourceText
|
||||
) where
|
||||
|
||||
import Data.Functor.Listable
|
||||
import Data.Record
|
||||
import Prologue
|
||||
import Category
|
||||
@ -24,9 +22,6 @@ import Range
|
||||
import SourceSpan
|
||||
import Data.Aeson
|
||||
|
||||
newtype Cost = Cost { unCost :: Int }
|
||||
deriving (Eq, Num, Ord, Show, ToJSON)
|
||||
|
||||
newtype SourceText = SourceText { unText :: Text }
|
||||
deriving (Show, ToJSON)
|
||||
|
||||
@ -50,8 +45,3 @@ sourceSpan = getField
|
||||
|
||||
setSourceSpan :: HasField fields SourceSpan => Record fields -> SourceSpan -> Record fields
|
||||
setSourceSpan = setField
|
||||
|
||||
-- Instances
|
||||
|
||||
instance Listable Cost where
|
||||
tiers = cons1 Cost
|
||||
|
@ -56,7 +56,7 @@ spec = parallel $ do
|
||||
describe "DiffInfo" $ do
|
||||
prop "patches in summaries match the patches in diffs" $
|
||||
\a -> let
|
||||
diff = unListableDiff a :: SyntaxDiff String '[Category, Cost, Range, SourceSpan]
|
||||
diff = unListableDiff a :: SyntaxDiff String '[Category, Range, SourceSpan]
|
||||
summaries = diffToDiffSummaries (source <$> blobs) diff
|
||||
patches = toList diff
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user