1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

add adjoinLines

This commit is contained in:
joshvera 2015-12-04 15:54:07 -05:00
parent 090635cd59
commit b4947255cf

View File

@ -118,6 +118,11 @@ adjoin2 (Row lefts [] : Row lefts' rights : init) (Row xs ys) =
Row (lefts <> xs) [] : Row lefts' (rights <> ys) : init
adjoin2 (last:init) row = (last <> row) : init
adjoinLines :: [Line] -> [Line] -> [Line]
adjoinLines [] lines = lines
adjoinLines lines [] = lines
adjoinLines accum (line : lines) = init accum ++ [ last accum <> line ] ++ lines
zipWithMaybe :: (Maybe a -> Maybe b -> c) -> [a] -> [b] -> [c]
zipWithMaybe f la lb = take len $ zipWith f la' lb'
where