User-defined distribution function example

@alejandromerchan my distribution is x\exp(-x) for x\in (0, \infty)
If I look at the example code from the post

type MyDist <: ContinuousUnivariateDistribution
    mu::Float64
    sigma::Float64
    MyDist(mu, sigma) = new(Float64(mu), Float64(sigma))
end

pdf(d::MyDist, x::Float64) = pdf(Normal(d.mu, 2*d.sigma), x)

I do not understand where should I introduce my function.
In this code the Normal distribution is used, but how to insert a custom function like f(x)=x*exp(-x) ?