1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 20:31:55 +03:00

Move the explicit annotation to the numberRows function

This commit is contained in:
joshvera 2015-12-10 23:38:54 -05:00
parent d2595b16cb
commit 6c423dc3b9

View File

@ -64,11 +64,13 @@ split diff before after = return . renderHtml
. body
. (table ! A.class_ (stringValue "diff")) $ toMarkup
[ (colgroup colgroupHtml),
tbody . mconcat $ toMarkup <$> ((reverse $ foldl numberRows [] rows) :: [(Int, Row)]) ]
tbody . mconcat $ toMarkup <$> (reverse $ foldl numberRows [] rows) ]
where
colgroupHtml :: Html
colgroupHtml = (toMarkup [ col ! A.width (stringValue "40"), col, col ! A.width (stringValue "40"), col ])
rows = fst $ diffToRows diff (0, 0) before after
numberRows :: [(Int, Row)] -> Row -> [(Int, Row)]
numberRows [] row = [(1, row)]
numberRows rows@((count, _):_) row = (count + 1, row):rows