From 6719aedde34c3a4f0ccb78931968c6fe490b3282 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 26 Mar 2004 20:08:30 +0000 Subject: Better help. --- src/GF/Data/Operations.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/GF/Data/Operations.hs') diff --git a/src/GF/Data/Operations.hs b/src/GF/Data/Operations.hs index 08ebdd45c..dd8e37380 100644 --- a/src/GF/Data/Operations.hs +++ b/src/GF/Data/Operations.hs @@ -311,6 +311,12 @@ type WParser a b = [a] -> [(b,[a])] -- old Wadler style parser wParseResults :: WParser a b -> [a] -> [b] wParseResults p aa = [b | (b,[]) <- p aa] +paragraphs :: String -> [String] +paragraphs = map unlines . chop . lines where + chop [] = [] + chop ss = let (ps,rest) = break empty ss in ps : chop (dropWhile empty rest) + empty = all isSpace + -- printing indent :: Int -> String -> String -- cgit v1.2.3