From 2eeccee06144314ed4a0ed579fb893aa2f322982 Mon Sep 17 00:00:00 2001 From: Jan Sucan Date: Tue, 7 Mar 2023 18:00:16 +0100 Subject: 1_a_4: Add solution --- ch01/1_a_4.hs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ch01/1_a_4.hs (limited to 'ch01/1_a_4.hs') diff --git a/ch01/1_a_4.hs b/ch01/1_a_4.hs new file mode 100644 index 0000000..3d5afb4 --- /dev/null +++ b/ch01/1_a_4.hs @@ -0,0 +1,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" -- cgit v1.2.3