A non-linear theory of longshore currents