Question: I assume natsplusbyfives is using my scale function. here is my code for reference: let odds = let generate _ odd n = makeStream n

I assume natsplusbyfives is using my scale function. here is my code for reference:
let odds =
let generate_odd n = makeStream n (n +2)(fun this state ->((this + state), state +2)) in
generate_odd 1 ;;
let rec trim count stream =
match count with
|0-> stream
|_-> trim (count -1)(rest stream) ;;
let scale factor stream =
let newFirst = first stream * factor in
let newRest = rest stream in
makeStream newFirst newRest (fun this state ->
let nextFirst = first state * factor in
let nextRest = rest state in
(nextFirst, nextRest))
let sum left right =
let newFirst = first left + first right in
let newRest =(rest left , rest right) in
makeStream newFirst newRest (fun (this, state)->
let nextFirst = first (fst state)+ first (snd state) in
let nextRest =(rest (fst state), rest (snd state)) in
(nextFirst, nextRest));;
Any ideas? I also didn't get any points for the other functions so is there a reason why none of them are working?
 I assume natsplusbyfives is using my scale function. here is my

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!