diff options
| author | Jan Sucan <jan@jansucan.com> | 2023-03-07 17:45:28 +0100 |
|---|---|---|
| committer | Jan Sucan <jan@jansucan.com> | 2023-03-07 17:45:28 +0100 |
| commit | 31101069ca89118b7e6a802460c80d80e0d17f20 (patch) | |
| tree | 897bb0caf918234d1ad2ffc9d48479358e215b0f | |
| parent | f1ccb49d6c5c30fc422f1eae595cf97615c5cb1a (diff) | |
1_a_2: Add solution
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | ch01/1_a_2.txt | 15 |
2 files changed, 16 insertions, 1 deletions
@@ -44,7 +44,7 @@ more visible in the list the first exercise of a group is in bold italics. | Exercise | Solved | Page | Chapter | | -------------- | ------ | ---- | ------- | | **_1_a_1_** | yes | 16 | 1. Getting started | -| 1_a_2 | | | | +| 1_a_2 | yes | | | | 1_a_3 | | | | | 1_a_4 | | | | | **_2_a_1_** | | 25 | 2. Types and functions | diff --git a/ch01/1_a_2.txt b/ch01/1_a_2.txt new file mode 100644 index 0000000..a4bffae --- /dev/null +++ b/ch01/1_a_2.txt @@ -0,0 +1,15 @@ +-- From ghci, type :? to print some help. Define a variable, such as let x = 1, +-- then type :show bindings. What do you see? + +ghci> :? + ... + + :show bindings show the current bindings made at the prompt + ... + +ghci> let x = 1 + +ghci> :show bindings +x :: Num a => a = _ + +-- We see a type of the bound variable 'x' |
