Comment

Comment by chills

I don't think it's particularly useful to think of unit as an empty tuple specifically, that is just an arbitrary but convenient definition for it.

Really a unit type is just one that contains only a single value. This is a unit in the same way that 1 is a unit for the integers. With some hand waving it is an identity for product types, for example (int, ()) is the "same" (xxxmorphic yada yada) as int

parent chills 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton