diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-23 00:08:39 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-23 00:08:39 +0300 |
commit | 71fdb64eb4784f259bb6651f5039d2c54e2d01e8 (patch) | |
tree | 60cc7e81e0c4ef37ac936290ad241e41df0ca81e /TUTORIAL.md | |
parent | 32fb9b036575c8b25a5318c7bce7699249990ff5 (diff) | |
download | myslip-71fdb64eb4784f259bb6651f5039d2c54e2d01e8.tar.gz myslip-71fdb64eb4784f259bb6651f5039d2c54e2d01e8.zip |
doc: added exercises 3 and 4
Diffstat (limited to 'TUTORIAL.md')
-rw-r--r-- | TUTORIAL.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/TUTORIAL.md b/TUTORIAL.md index e0017d6..30e7d62 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -466,3 +466,29 @@ n saved > (fibonacci n) 34 : Int ``` + + +Exercise 3: Generic functions – the identity +-------------------------------------------- + +Write the identity function for any type. + +This should make you familiar with typing function +definitions that contain generics. + + +Exercise 4: Map left / right (integers) +--------------------------------------- + +Write functions `map-left` and `map-right` that take a +coproduct and a function and map the corresponding side of +the given coproduct using the given function. + +Note: the solution is not in the same directory as the rest, +but you can find implementations for these in the standard +library. + +This exercise will train your abilities to use generics more +than the last one. You will get familiar with coproducts. + + |