From 12a4dee6abb12b27f6921662fd3000421c47a127 Mon Sep 17 00:00:00 2001 From: Jan Sucan Date: Tue, 7 Mar 2023 17:55:18 +0100 Subject: 1_a_3: Add solution --- README.md | 2 +- ch01/1_a_3.hs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 ch01/1_a_3.hs diff --git a/README.md b/README.md index 9c0c589..ca74297 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ more visible in the list the first exercise of a group is in bold italics. | -------------- | ------ | ---- | ------- | | **_1_a_1_** | yes | 16 | 1. Getting started | | 1_a_2 | yes | | | -| 1_a_3 | | | | +| 1_a_3 | yes | | | | 1_a_4 | | | | | **_2_a_1_** | | 25 | 2. Types and functions | | **_2_b_1_** | | 39 | | diff --git a/ch01/1_a_3.hs b/ch01/1_a_3.hs new file mode 100644 index 0000000..9a3d64d --- /dev/null +++ b/ch01/1_a_3.hs @@ -0,0 +1,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" -- cgit v1.2.3