mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
🔥 the unused Arbitrary instance over PrettyDiff.
This commit is contained in:
parent
04e36c4dcb
commit
5fad7be0f5
@ -221,10 +221,6 @@ toAlignBranchInputs elements = (sources, join . (`evalState` both 0 0) . mapM go
|
|||||||
ranges = Source.actualLineRanges <$> (totalRange <$> sources) <*> sources
|
ranges = Source.actualLineRanges <$> (totalRange <$> sources) <*> sources
|
||||||
bothContents = foldMap (modifyJoin (fromThese [] []) . fmap (:[]) . branchElementContents)
|
bothContents = foldMap (modifyJoin (fromThese [] []) . fmap (:[]) . branchElementContents)
|
||||||
|
|
||||||
toPrettyDiff :: [BranchElement] -> PrettyDiff [(String, Range)]
|
|
||||||
toPrettyDiff elements = PrettyDiff sources (alignBranch id children ranges)
|
|
||||||
where (sources, children, ranges) = toAlignBranchInputs elements
|
|
||||||
|
|
||||||
keysOfAlignedChildren :: [Join These (Range, [(String, Range)])] -> [String]
|
keysOfAlignedChildren :: [Join These (Range, [(String, Range)])] -> [String]
|
||||||
keysOfAlignedChildren lines = lines >>= these id id (++) . runJoin . fmap (fmap Prelude.fst . Prelude.snd)
|
keysOfAlignedChildren lines = lines >>= these id id (++) . runJoin . fmap (fmap Prelude.fst . Prelude.snd)
|
||||||
|
|
||||||
@ -246,9 +242,6 @@ instance Arbitrary BranchElement where
|
|||||||
(prefix, suffix) = ('(' : key, ")" :: String)
|
(prefix, suffix) = ('(' : key, ")" :: String)
|
||||||
shrink (Margin contents) = Margin <$> crosswalk (shrinkList (const [])) contents
|
shrink (Margin contents) = Margin <$> crosswalk (shrinkList (const [])) contents
|
||||||
|
|
||||||
instance Arbitrary (PrettyDiff [(String, Range)]) where
|
|
||||||
arbitrary = toPrettyDiff <$> listOf1 arbitrary
|
|
||||||
|
|
||||||
counts :: [Join These (Int, a)] -> Both Int
|
counts :: [Join These (Int, a)] -> Both Int
|
||||||
counts numbered = fromMaybe 0 . getLast . mconcat . fmap Last <$> Join (unalign (runJoin . fmap Prelude.fst <$> numbered))
|
counts numbered = fromMaybe 0 . getLast . mconcat . fmap Last <$> Join (unalign (runJoin . fmap Prelude.fst <$> numbered))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user