Description
In the data model, are we okay with treating functions as first-class data, such that we can include functions as a part of the data model for MF input?
@zbraniecki 's presentation on the Fluent-based POC showed the use of references to functions that can be used for custom placeholder formatting. @mihnita 's previous presentation on the data model discussed the idea of custom formatters for placeholders by indicating where those formatting args could be stored, and this too might require function interfaces to be defined to enable user-defined custom formatters.
I'm in favor of saying that we can treat functions as data, and thus, include them as fields in our data model. One counter-argument to the idea would be that not all programming languages allow first-class functions.
My perspective is that, for our purposes, declaring the type of a function and declaring a function interface are equivalent (arg types and return type). Most languages these days have interfaces/traits or first-class fns, and even for the few that don't, they do not need those languages features to create an implementation compatible with the data model.
If we do define behavior as fn interfaces or first-class fns, then it might open up different ways of addressing problems or implementing details. As a hypothetical example, if we want to generalize the notion of a default selection of a message variant in a multi-select message when placeholder values are absent, instead of relying on the structure of the message variants or adding fields to the data model, we could represent the selection process as a function. There could be a spec for fn behavior and the rest could be left to implementation details.