Convert `next` to Cadence.

See #375.