Inside DrMark’s Lab

Inside DrMark’s Lab

Classifying Functions by Sets and by Types

Same inputs, different headaches, and one compiler that refuses to be your therapist!

The Unshielded Mind's avatar
The Unshielded Mind
Sep 21, 2025
∙ Paid
Share

When teaching advanced topics on programming languages and computing theory students often want to clarify the differences between the usages of the term function in different contexts. A function can be described in two ways. In set thinking you specify a domain and a codomain, then say the function assigns to every input in the domain exactly one output in the codomain. In type thinking you specify the input type and the output type of a computation, then require that any implementation respect the rules carried by those types. The two views often lead to different solutions once you try to build real systems.

When we say that a set or a type classifies a function, we are referring to how functions can be described or categorized based on their input and output. The notion of classification depends on whether we are in the context of set theory (sets) or type theory (types). Let me explain this concept in both contexts.

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Markgrechanik@gmail.com
Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture