Better help.

This commit is contained in:
aarne
2004-03-26 20:08:30 +00:00
parent 2433403b62
commit 6719aedde3
11 changed files with 81 additions and 26 deletions

View File

@@ -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