From a4f7761182b15f4865c77e7cadfc7ccb353c0003 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 1 Dec 2019 22:26:14 +1100 Subject: [PATCH] Add glossary entry for utility types --- doc/glossary.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/glossary.md b/doc/glossary.md index e3ff233c..9750bd40 100644 --- a/doc/glossary.md +++ b/doc/glossary.md @@ -82,3 +82,14 @@ Arithmetic that stops at certain bounds, such as `0` and `255` for the #### Situation The set of [facts](/doc/note/facts.md) at a given point in a program. + +#### Utility Type + +An empty struct (with no fields) used as a placeholder. Every written-in-Wuffs +function is a method: the receiver is mandatory. A Wuffs utility type's methods +are to its package what C++ or Java's static methods are to its class. + +"Utility type" is merely a Wuffs naming convention. For example, Wuffs' `base` +package has a type called `base.utility`, similar to how the `zlib` package has +a type called `zlib.decoder`. Unlike "dependent type" or "refinement type", +"utility type" is not a phrase used in programming language type theory.