From 7abe07bd1639c59eb6e7469b0e7830aad56dad5c Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 10 Dec 2015 13:15:32 -0500 Subject: [PATCH] actualLines ends lines with their newlines. --- src/Split.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Split.hs b/src/Split.hs index 446bebb21..9125f0880 100644 --- a/src/Split.hs +++ b/src/Split.hs @@ -234,8 +234,6 @@ classify = foldr (const . Just . ("category-" ++)) Nothing actualLines :: String -> [String] actualLines "" = [""] actualLines lines = case break (== '\n') lines of - (l, lines') -> l : (case lines' of - [] -> [] - _:lines' -> (case actualLines lines' of - [] -> ["\n"] - s:rest -> ('\n' : s) : rest)) + (l, lines') -> (case lines' of + [] -> [ l ] + _:lines' -> (l ++ "\n") : actualLines lines')