A dataset is not a function, because it is partial and multivalued, so it lives in a Kleisli category, and choosing the monad chooses what “impure” means.
A dataset
where multivaluedness becomes a subset of labels and partiality becomes the empty set
Remark on monads as purification along two axes
Reading a partial, multivalued relation as a pure Kleisli arrow moves the impurity into the monad, along two independent axes. The totality axis is governed by the
monad , which legalises “no answer”; the uniqueness axis by the monad, which legalises “several answers”. Their combination is the full relational reading, and is the quantitative refinement of , carrying weights instead of a bare subset.
References
- M. Giry, A categorical approach to probability theory (1982)