  Heavy quarks are produced in the early stages of ultra-relativistic heavy-ion
collisions, and their number is preserved throughout the subsequent evolution
of the system. Therefore, they constitute ideal probes for characterising the
Quark--Gluon Plasma (QGP) medium and for the study of its transport properties.
In particular, heavy quarks interact with the partonic constituents of the
plasma, losing energy, and are expected to be sensitive to the medium
collective motion induced by its hydrodynamical evolution. In pp collisions,
the measurement of heavy-flavour hadron production provides a reference for
heavy-ion studies, and allows also testing perturbative QCD calculations in a
wide range of collision energies. Similar studies in p--Pb collisions help in
disentangling cold nuclear matter effects from modifications induced by the
presence of a QGP medium, and are also useful to investigate the possible
existence of collective phenomena also in this system. The ALICE detector
provides excellent performances in terms of particle identification and
vertexing capabilities. Hence, it is fully suited for the reconstruction of
charmed mesons and baryons and of electrons from heavy-flavour hadron decays at
central rapidity. Furthermore, the ALICE muon spectrometer allows
reconstructing heavy-flavour decay muons at forward rapidity. A review of the
main ALICE results on open heavy flavour production in pp, p--Pb and Pb--Pb
collisions is presented. Recent, more differential measurements are also shown,
including azimuthal correlations of heavy-flavour particles with charged
hadrons in p--Pb collisions, and D-meson tagged-jet production in p--Pb and
Pb--Pb collisions.
