Any way to compare two lambdas to determine if they're equal (when they have been constructed separately with the same builder)
p
Paul Woitaschek
07/27/2020, 7:38 PM
Run them with the same arguments and check their outputs?
p
phldavies
07/30/2020, 3:13 PM
Rather than constructing a lambda you could construct a (private) data class that extends the appropriate function interface, and captures the required arguments for equality: https://pl.kotl.in/juj0ZQtu8