diff options
author | Raúl Benencia <rul@kalgan.cc> | 2013-09-01 13:16:54 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2013-09-01 13:16:54 -0300 |
commit | 917de9c6df342d032e2b05238c7ea923da2772db (patch) | |
tree | 78b8f56b03ed07f4d9f055149a0e974d47609057 /Print.hs | |
parent | 39f53d2775f38514a537f03c7b72281ec31a3c0e (diff) |
towards mime library
Diffstat (limited to 'Print.hs')
-rw-r--r-- | Print.hs | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -16,20 +16,12 @@ import Text.ParserCombinators.Parsec.Rfc2822(NameAddr(..)) import Email import Rfc1342 -nameLen = 20 -ppNameAddr nas = intercalate ", " $ map ppNameAddr' nas - where ppNameAddr' na = case nameAddr_name na of - Nothing -> nameAddr_addr na - Just n -> unquote (decodeField n) ++ " <" ++ nameAddr_addr na ++ ">" - -ppIndexNameAddr nas = normalizeLen nameLen $ concat $ map ppNameAddr' nas - where ppNameAddr' na = case nameAddr_name na of - Nothing -> nameAddr_addr na - Just n -> unquote (decodeField n) - unquote xs= if (head xs == '"' && last xs == '"') then (tail . init) xs else xs -ppSubject = flat . decodeField +ppField = flat . decodeField + +fromLen :: Int +fromLen = 20 flat xs = intercalate " " $ map (dropWhile isSpace) $ map (filter (/= '\r')) $ lines xs |