SML Help : ml
This is a discussion on SML Help within the ml forums in Programming Languages category; Hello, Can anyone help me on that... plsss I have to make a list.. composelist: (Žab -> Žab)list -> Žab -> Žab, such that if [f1, ..., fn] is a list of suncions of type Žab -> Žab and x is a value of type Žab, then the call composelist [f1, ..., fn] x will return the value vf1(f2(... fn-1(fn(x)))). In the case where n = 0 (the list of dunction is empty) composelist [] x should return x. composelist [fn y => Y*Y, fn z => z+1, fn w => div 2] 4 should return the value 9 (= ...
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| Can anyone help me on that... plsss I have to make a list.. composelist: (Žab -> Žab)list -> Žab -> Žab, such that if [f1, ..., fn] is a list of suncions of type Žab -> Žab and x is a value of type Žab, then the call composelist [f1, ..., fn] x will return the value vf1(f2(... fn-1(fn(x)))). In the case where n = 0 (the list of dunction is empty) composelist [] x should return x. composelist [fn y => Y*Y, fn z => z+1, fn w => div 2] 4 should return the value 9 (= ((4div2)+1)* ((4div2)+1)). Thanks in advance... |


