The earliest Newton reference of which I am aware is Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire (1991), where iirc both the bananas and the lenses are (visually!) optical.
https://research.utwente.nl/en/publications/functional-progr...
In particular, the metaphor isn't used in Algorithmics: Towards Programming as a Mathematical Activity (1986).