![]() |
.. (לתיקייה המכילה) | |
Why do I get the following error:
|
- fn x y => x+y; stdIn:15.1-15.14 Error: non-constructor applied to argument in pattern: x stdIn:15.13 Error: unbound variable or constructor: y stdIn:15.11 Error: unbound variable or constructor: x The syntactic sugar for defining a curried function doesn't work for anonymous functions. Just define it regularly: fn x => (fn y => x+y); |
Q2 b & Q2 c: Can we assume that there are no leading zeros in the input?
|
Yes you can. You may also assume that you are not receiving 0 as an input. |
Q4: Can you please explain how to test q4?
|
There is no need to test. Just make sure you get the exact same type. |
Q4 1: Do we have to have the exact same function type?
Will this type be accepted:
val func = fn : 'a * 'b -> 'c * 'd -> 'e -> 'c ?
| The point of the question is to define a function that has the exact same type. |
Q2 c: can we use Q2a or Q2b?
| Yes you can. |
Can we use functions we implemented in the previous questions and previous paragraphs (סעיפים)?
| Yes you can. |
Are 1, 2 prime numbers?
| 1 is not a prime number, 2 is. |

