Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
fp2025:hw1 [2025/03/21 12:39]
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: ''​op (op (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: ''​op (op (op b))''​. Use direct recursion instead of tail recursion.
 <code scala> <code scala>
   def foldRightSet   def foldRightSet