blob: 3d5afb499a94b9bded9bd8f76a4b116c05e75b1a (
plain)
1
2
3
4
5
|
-- Modify the WC.hs example again, to print the number of characters in a file.
-- Type of 'input' is String. Its length is the number of characters.
main = interact wordCount
where wordCount input = show (length input) ++ "\n"
|