3 ms·
It’s called “unit” because it is a unit of the operation of multiplication / constructing a tuple (up to a unique isomorphism): for any type 't the tuple types
by mananaysiempre 2y ago
It’s called “unit” because it is a unit of the operation of multiplication / constructing a tuple (up to a unique isomorphism): for any type 't the tuple types unit * 't and 't * unit are isomorphic to 't. When you don’t have that as a fundamental operation in your type system, like ML does, then it could be confusing.
- xdavidliu 2y agosure, but I would be surprised if a significant fraction of programmers knew that. When we hear the word "unit", that's not the first definition that comes to mind.