module Main where import Data.Char import Data.List main = do words <- readFile "/etc/dictionaries-common/words" let wordlist = lines words mapM_ putStrLn $ filter bestword wordlist -- putStrLn $ show $ length $ filter goodword wordlist -- 469 -- putStrLn $ show $ length $ filter bestword wordlist -- 187 goodword word = all (\c -> elem c $ map toLower word) "aeiou" && notElem '\'' word bestword word = all (\c -> length (findIndices (`elem` (c:[])) (map toLower word)) == 1) "aeiou" && notElem '\'' word
說好的高亮呢?code