Fragmentation functions are one of the key components of the factorisation theorem used to calculate heavy-flavour hadron production cross sections. The non-perturbative nature of fragmentation functions necessitates that they are constrained through experimental measurements, commonly performed in the clean environments of $\mathrm{e}^{+}\mathrm{e}^{-}$ and ep collisions. However, recent measurements of charm-hadron transverse-momentum spectra and the ratios of charmed-hadron abundances in pp collisions have questioned the universality of fragmentation functions between leptonic and hadronic collision systems in the baryon sector.
In this contribution, we present measurements of differential observables of heavy-flavour hadrons that also consider the hadronic density surrounding the hadron. These measurements provide additional information to the previously reported baryon-to-meson results and allow us closer access to the charm fragmentation functions. We report the fraction of longitudinal momentum carried by $\mathrm{D^{0}}$ and $\mathrm{D^{+}_{s}}$ mesons as well as $\Lambda^{+}_\mathrm{c}$ baryons. We also report the azimuthal correlation distributions between heavy-flavour decay electrons and charged particles in pp and p--Pb collisions, as well as between $\Lambda^{+}_\mathrm{c}$ baryons and charged particles in pp collisions, which provide quantitative access to the angular profile, $p_{\mathrm{T}}$ and multiplicity distributions of the jets produced by the heavy-quark fragmentation.