Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
fp2025:hw1 [2025/03/21 12:38] dmihai |
fp2025:hw1 [2026/04/24 10:17] (current) andrei.nicola |
||
|---|---|---|---|
| Line 78: | Line 78: | ||
| </code> | </code> | ||
| - | **9.** Implement an alternative to the previous function, namely **foldRight**. Applying ''foldRight'' on the set ''{x,y,z}'' with initial value ''b'' should produce: ''a op (b op (c op b))''. Use direct recursion instead of tail recursion. | + | **9.** Implement an alternative to the previous function, namely **foldRight**. Applying ''foldRight'' on the set ''{x,y,z}'' with initial value ''b'' should produce: ''x op (y op (z op b))''. Use direct recursion instead of tail recursion. |
| <code scala> | <code scala> | ||
| def foldRightSet | def foldRightSet | ||
| Line 127: | Line 127: | ||
| * Please follow the [[fp2025:submission-guidelines| Submission guidelines]] which are the same for all homework. | * Please follow the [[fp2025:submission-guidelines| Submission guidelines]] which are the same for all homework. | ||
| - | * To solve your homework, download the {{:fp2024:hw1-functions-as-sets.zip| Project template}}, import it in IntellIJ, and you are all set. Do not rename the project manually, as this may cause problems with IntellIJ. | + | * To solve your homework, download the {{:fp2025:hw1-functions-as-sets.zip| Project template}}, import it in IntellIJ, and you are all set. Do not rename the project manually, as this may cause problems with IntellIJ. |