Im new to functional programming and I have an assignment to compute partial sum of a list. E.g. - psum [1,1,1,1,1]; val it = [1,2,3,4,5] : int list
Here is the my cod
Your question is a little broad, but here's one way to sum a list. Perhaps you can adapt it to your purposes:
fun sum [] = 0 | sum (h::t) = h + sum t