  We present a useful function for describing the profiles of dark-matter
haloes with a varying asymptotic inner slope -\alpha, ranging from a cusp to a
core, where the profiles of density, mass-velocity and potential are simple
analytic expressions for any \alpha. The idea is to express the mean-density
profile as a simple functional form, and obtain the local density by
derivative. The model involves a concentration parameter c analogous to the NFW
profile. More flexibility is provided by a sum of two such functions, with
concentrations c_1 and c_2. An optional additional parameter is the asymptotic
outer slope -\gamma, which allows more flexibility in the outskirts of haloes.
For \gamma different than 3, there are analytic expressions for the profiles of
density and mass-velocity but not for the potential. We match the proposed
function, in different variants, to the dark-matter profiles of haloes in
cosmological simulations, with and without baryons, spanning inner profiles
that range from steep cusps to flat cores, and find excellent fits. The
analytic potential profile is useful in modeling the evolution of the inner
halo due to episodes of gas inflow and outflow. The analytic profile,
especially with a free \gamma, is useful for a study of environmental effects
in the outer halo. In general, these analytic profiles can serve for
straightforwardly quantifying the shapes of simulated and observed rotation
curves, without the need for numerical integrations.
