jean
08/18/2025, 9:30 AM• If your API needs to accept a function (any function) with some specific parameter and return types – use a simple functional type or define a type alias to give a shorter name to the corresponding functional type.
• If your API accepts a more complex entity than a function – for example, it has non-trivial contracts and/or operations on it that can’t be expressed in a functional type’s signature – declare a separate functional interface for it.Do you have any examples where a type aliases wouldn’t be enough and one could leverage a fun interface instead? I’ve been using fun interfaces for a while but they could all be replaced with type aliases I think
Chris Lee
08/18/2025, 3:13 PM