A functional approach to probability distribution