let square x = x * x ;; let rec fact x = if x=0 then 1 else x * fact (x-1);; let rec sum ys = match ys with [] -> 0 | (x::xs) -> x + sum xs;; let rec length ys = match ys with [] -> 0 | (x::xs) -> 1 + length xs;; let rec append zs ys = match zs with [] -> ys | (x::xs) -> x :: append xs ys;; let rec map f ys = match ys with [] -> [] | (x::xs) -> f x :: map f xs;;