From c416bdb936f170377eb71868e7b3f59a667819db Mon Sep 17 00:00:00 2001 From: Jan Sucan Date: Wed, 8 Mar 2023 18:21:07 +0100 Subject: 2_a_1: Add solution --- README.md | 2 +- ch02/2_a_1.txt | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ch02/2_a_1.txt diff --git a/README.md b/README.md index e7eb274..c2f8d5d 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ more visible in the list the first exercise of a group is in bold italics. | 1_a_2 | yes | | | | 1_a_3 | yes | | | | 1_a_4 | yes | | | -| **_2_a_1_** | | 25 | 2. Types and functions | +| **_2_a_1_** | yes | 25 | 2. Types and functions | | **_2_b_1_** | | 39 | | | 2_b_2 | | | | | 2_b_3 | | | | diff --git a/ch02/2_a_1.txt b/ch02/2_a_1.txt new file mode 100644 index 0000000..26ad22b --- /dev/null +++ b/ch02/2_a_1.txt @@ -0,0 +1,15 @@ +-- What are the types of the following expressions? 4 comments +-- - False +-- - (["foo", "bar"], 'a') +-- - [(True, []), (False, [['a']])] + +-- Let's use ghci to check our answers + +ghci> :t False +False :: Bool + +ghci> :t (["foo", "bar"], 'a') +(["foo", "bar"], 'a') :: ([String], Char) + +ghci> :t [(True, []), (False, [['a']])] +[(True, []), (False, [['a']])] :: [(Bool, [[Char]])] -- cgit v1.2.3