A functional raytracer