## 1 Introduction
Different regimes of pulse generation at net anomalous or normal dispersion can be realised in a DM fibre laser via appropriate in-cavity dispersion management [20; 21; 22]. Commonly-employed methods to achieve flexible control of in-cavity dispersion include grating pairs, prisms or simply physically changing the length of the fibre in the cavity [20; 21; 22; 23]. Furthermore, the possibility to achieve both parabolic self-similar and triangular pulse shaping in a mode-locked fibre laser via adjustment of the net normal dispersion and integrated gain of the cavity was reported in [24]. In [25], careful control of the gain/loss parameters of a net-normal dispersion laser cavity provided the means of achieving switching among Gaussian pulse, DS and similarton pulse solutions in the cavity. All of these techniques, however, require manual tuning of some physical parameters of the cavity. Spectral pulse shaping [26] is a technique that employs spectral manipulation of the intensity and phase components of a pulse in order to create the desired field distribution. It has been highly successful for applications in a number of fields [27; 28]. However, since the pulse shaper is normally placed outside a laser cavity, it requires careful alignment between the wavelength of the shaping filter and the emission wavelength of the laser, and its control of the laser field is limited; the bandwidth of the filtered spectrum is determined by the bandwidth of the input spectrum, and manipulation of the in-cavity dynamics of the laser is not possible. In addition, the pulse shaper can only subtract power from the frequency components of the signal while manipulating its intensity, thereby potentially making the whole process extremely power inefficient. Fully-programmable amplitude and phase filters [29] are already commercially available and extensively used in telecommunications applications [30]. The use of such filters, when placed inside a laser cavity, has the potential to allow the operation of lasers that exhibit pulse characteristics that can be controlled purely through software control. The inclusion of a pulse shaper into the cavity of a passively-mode-locked fibre laser was recently demonstrated [31], allowing for the tunability of the laser wavelength and operation at high repetition rates. In [32; 33], the phase-filtering ability of an in-cavity pulse shaper was shown to enable precise control of the cavity dispersion of the laser, as well as to change the output pulse train from bright to dark pulses. In this paper, we review our recent results and advances in the area, by numerically describing a novel approach to achieving different regimes of pulse generation in a passively-mode-locked fibre laser, which relies on nonlinear in-cavity pulse dynamics and pulse shaping by an in-cavity amplitude and phase spectral filter [34]. By changing the amplitude profile applied on the filter, we are able to create various output temporal waveforms of fundamental and practical interest, ranging from bright and dark parabolic profiles to a flat-top profile and triangular and saw-tooth (asymmetric triangular) profiles [35]. As an application of this general approach, we show that the use of an in-cavity flat-top spectral filter makes it possible to directly generate sinc-shaped Nyquist pulses of high quality and of a widely-tunable bandwidth from the laser [36]. We also report on a recently-developed versatile erbium-doped fibre (EDF) laser, in which conventional soliton, DM soliton and DS mode-locking regimes can be selectively and reliably targeted by programming different GVD profiles and bandwidths on an in-cavity programmable filter [37].