1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 04:11:48 +03:00

Last returns non-Nothing, so bind instead.

This commit is contained in:
Rob Rix 2015-12-10 16:43:31 -05:00
parent 85d141e924
commit 674301ce1f

View File

@ -231,9 +231,9 @@ rightLines rows = right <$> rows
openElement :: HTML -> Maybe HTML
openElement Break = Nothing
openElement (Ul _ elements) = getLast . mconcat . map Last $ openElement <$> elements
openElement (Dl _ elements) = getLast . mconcat . map Last $ openElement <$> elements
openElement (Div _ elements) = getLast . mconcat . map Last $ openElement <$> elements
openElement (Ul _ elements) = openElement =<< maybeLast elements
openElement (Dl _ elements) = openElement =<< maybeLast elements
openElement (Div _ elements) = openElement =<< maybeLast elements
openElement h = Just h
openLine :: [Line] -> Maybe Line