Semantics of Functional Probabilistic Programs