mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
Compute openLineBy across Both sides.
This commit is contained in:
parent
6170622468
commit
7f73085dd5
@ -21,7 +21,7 @@ wrapRowContents transformLeft transformRight (Row left right) = Row (wrapLineCon
|
||||
adjoinRowsBy :: MaybeOpen a -> MaybeOpen a -> [Row a] -> Row a -> [Row a]
|
||||
adjoinRowsBy _ _ [] row = [row]
|
||||
|
||||
adjoinRowsBy f g rows (Row left' right') | Just _ <- openLineBy f $ unLeft <$> rows, Just _ <- openLineBy g $ unRight <$> rows = uncurry (zipWith Row) . runBoth $ both <*> Both (left', right')
|
||||
adjoinRowsBy f g rows (Row left' right') | Both (Just _, Just _) <- openLineBy <$> Both (f, g) <*> Both (unzip $ runBoth . unRow <$> rows) = uncurry (zipWith Row) . runBoth $ both <*> Both (left', right')
|
||||
where both = adjoinLinesBy <$> Both (f, g) <*> Both (unzip $ runBoth . unRow <$> rows)
|
||||
|
||||
adjoinRowsBy f _ rows (Row left' right') | Just _ <- openLineBy f $ unLeft <$> rows = case right' of
|
||||
|
Loading…
Reference in New Issue
Block a user