Profiling for functional programs