1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00

🔥 isClosedRowBy.

This commit is contained in:
Rob Rix 2016-03-08 22:18:19 -05:00
parent 3cb0cd4ac4
commit 1f6f319842

View File

@ -21,9 +21,6 @@ unRight = snd . unRow
isOpenRowBy :: Both (a -> Bool) -> Row a -> Bool
isOpenRowBy f = runBothWith (&&) . (isOpenLineBy <$> f <*>) . unRow
isClosedRowBy :: Both (a -> Bool) -> Row a -> Bool
isClosedRowBy f = not . runBothWith (||) . (isOpenLineBy <$> f <*>) . unRow
coalesceLinesBy :: (a -> Bool) -> Line a -> Line a -> [Line a]
coalesceLinesBy f line nextLine | isOpenLineBy f line = [line <> nextLine]
coalesceLinesBy _ line nextLine = [line, nextLine]