blob: 9a3d64d7c03cc5ed48ff25f5c7328d799efc2f86 (
plain)
1
2
3
4
5
|
-- The words function counts the number of words in a string. Modify the WC.hs
-- example to count the number of words in a file.
main = interact wordCount
where wordCount input = show (length (words input)) ++ "\n"
|