Packing of spheres in Haskell