Name: Anonymous 2008-04-15 9:09
Can someone post picturse of the late Haskell? Also, what type of dog was she?
cleanChars [] = []
cleanChars s =
head $ mapMaybe (\(a, u) -> fmap ((chr u:) . cleanChars) $ stripPrefix a s) rep
where
rep = [("...", 0x2026), ("?!", 0x203D), ("??", 0x2047),
("!?", 0x2049), ("!!", 0x203C), ("``", 0x275D),
("''", 0x275E), (" ", 0x3000), ("`", 0x275B),
("'", 0x275C)] ++ map (\c -> ([c], ord c + 0xfee0)) [' '..'~']
++ map (\o -> ([chr o], o)) [0..]