loss function in terms of distribution and label I received an answer to a question about learning, and I noticed the writer gave loss functions as $l(p,y)$, where $p$ is a predicted distribution, and $y$ is a class index.
https://stats.stackexchange.com/a/589070/96019
Does anyone have a reference where loss functions for classification of any other problem are given this way? The writer convinced me there is a usefulness in the formulation, so I would like to see a reference material to study further.

As whuber notes, this is a very standard formulation. (How else would you denote a loss that depends on a probabilistic prediction and an observed outcome?)
Such loss functions are called scoring rules, and the tag wiki has pointers to literature, and an example of this notation: $s(y, \hat{y})$ denotes the score for a probabilistic prediction $\hat{y}$ and the corresponding outcome $y$. As an example, I just randomly looked into Gneiting, Balabdaoui & Raftery (2007) and see this notation in section 3.4 on scoring rules.
