Convert `toLeaf` to Cadence.

See #375.