mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Implement catThese in terms of Union.
This commit is contained in:
parent
c547f4e13d
commit
17728c5f6d
@ -161,9 +161,7 @@ spanAndSplitFirstLines pred = foldr go ([], [])
|
|||||||
| otherwise = (intersecting, nonintersecting)
|
| otherwise = (intersecting, nonintersecting)
|
||||||
|
|
||||||
catThese :: [Join These a] -> Join These [a]
|
catThese :: [Join These a] -> Join These [a]
|
||||||
catThese [ a ] = pure <$> a
|
catThese as = maybe (Join (These [] [])) Join $ getUnion $ mconcat $ Union . Just . runJoin . fmap pure <$> as
|
||||||
catThese (a:as) = fromMaybe (Join (These [] [])) $ (:) <$> a `applyThese` catThese as
|
|
||||||
catThese [] = Join (These [] [])
|
|
||||||
|
|
||||||
-- | Partitions and splits a list of children into a tuple consisting of:
|
-- | Partitions and splits a list of children into a tuple consisting of:
|
||||||
-- | - elements which matched; if an element matches only partially this field will contain only the matching side
|
-- | - elements which matched; if an element matches only partially this field will contain only the matching side
|
||||||
|
Loading…
Reference in New Issue
Block a user