Direct linearisation of discrete and continuous integrable systems: The KP hierarchy and its reductions