diff options
Diffstat (limited to 'comp/work/53/sheet')
-rw-r--r-- | comp/work/53/sheet | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/comp/work/53/sheet b/comp/work/53/sheet new file mode 100644 index 0000000..45058ac --- /dev/null +++ b/comp/work/53/sheet @@ -0,0 +1,68 @@ +12.1) +head | 1 +tail | [2, 3, 4] + +12.2) +[2, 4, 6, 8] + +12.3) +I fisrt put the list into the function map, because the list was not empty, I used the second definition. +I applied f to the head of the list, then I applied map onto the tail of the list. +Because the tail was not empty I repeated this again. +I repeated this until I got an empty list +Then the most recent call to map returns, and gets conncatinated to the second to last function calling f on x. +This repeates as the call stack collapses, leaving behind the list, with all values having f applied to x + +8.1) +WHO KNOWS + +8.2) +36 + +8.3) to apply a function onto a list in a specific order. + +6.1) +10 + +6.2) +map square a | [1, 9, 25] +filter (<10) b | [1, 5] +fold (+) 0 c | 18 + +6.3) +A function that takes another function as an argument or a returns function as a result + +15.1) +3 + +15.2) +fw [4, 3] | 12 +fx sales | [20, 50, 32] +fz sales | 102 + +15.3) +This is the total of sales, the amount sold in a day perhaps + +7.1) +NO CLUE + +7.2) +4 + +7.3) +plus4 = add 4 +result = plus4 6 +' +11.1) +head | "Blackpool" +tail | ["Paris", "New Brighton", "Toronto"] + +11.2) +A function that takes another function as an argument or a returns function as a result + +11.3) +(((1 * 2) * 3) * 2) +((2 * 3) * 2) +(6 * 2) +(12) +12 |