Created
February 27, 2015 09:49
-
-
Save MiyamonY/9a8ea7eba421d3b75d34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main :: IO () | |
main = do | |
contents <- getContents | |
putStr $ shortLinesOnly contents | |
shortLinesOnly :: String -> String | |
shortLinesOnly = unlines . filter (\ line -> length line < 10) . lines | |
-- lines :: String -> [String] | |
-- lines "aaa\nbbb\nccc" => ["aaa","bbb","ccc"] | |
-- unlines :: [String] -> String | |
-- unlines ["aaa", "bbb", "ccc"] => "aaa\nbbb\nccc\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment