-- Slide 15 e1 x n = case n of 0 -> 1 _ -> x * e1 x (n - 1) e2 x n = if n == 0 then 1 else if even n then e2 (x * x) (div n 2) else x * e2 (x * x) (div n 2)