declare fun {Sum Lst} case Lst of H|T then H + {Sum T} [] nil then 0 end end {Browse {Sum 1|2|3|7|nil}} {Browse {Sum [2 3 7]}}