Well I was thinking about how to sum lists. I got down a function to sum a basic 1d list i.e sum[1,2, 3] = 6
However, I couldn't figure out how to sum 2d, or 3d, etc lists i.e sum[[1, 2], [3, 4]] = [3, 7] = 10
Here's how I defined sum for 1d lists
sum[] = 0
sum [Head ... Tail] = Head + sum Tail
So I was thinking, I'll check if it is an integer or a list then act accordingly. i.e
sum[1, [2, 3]]
Head = 1 (int) + sum [2, 3]
This equates to 1 + [[2, 3]] and returns 1 + [2, 3]
However, if I could check if tail is a list, I could sum car Tail, where car[Head ... Tail] = Head
Or am I just going about this like a functional programming amateur?