aboutsummaryrefslogtreecommitdiff
path: root/ch02/2_a_1.txt
diff options
context:
space:
mode:
authorJan Sucan <jan@jansucan.com>2023-03-08 18:21:07 +0100
committerJan Sucan <jan@jansucan.com>2023-03-08 18:21:07 +0100
commitc416bdb936f170377eb71868e7b3f59a667819db (patch)
tree263b746ce2e3c98548343a4c7c3bc743de471350 /ch02/2_a_1.txt
parent2eeccee06144314ed4a0ed579fb893aa2f322982 (diff)
2_a_1: Add solution
Diffstat (limited to 'ch02/2_a_1.txt')
-rw-r--r--ch02/2_a_1.txt15
1 files changed, 15 insertions, 0 deletions
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]])]