4 ms·
> this is a classic case of not needing more types but needing proper names. Those are types.
by hither_shores 4y ago
> this is a classic case of not needing more types but needing proper names.
Those are types.
- Barrin92 4y agono. a type is a description of a set of values and its associated operations. Types impose global meaning on entities in your program. When something belongs to a certain type receivers of arguments of that type lose control over how to interpret them. Thus types introduce coupling. Names are just labels attached to an entity for the purpose of identification and readability, they don't impose meaning.
- hither_shores 4y agonewtype ArbitrarilyLabeled x = ArbitrarilyLabeled x forgetLabel :: ArbitrarilyLabeled x -> x forgetLabel (ArbitrarilyLabeled x) = x What's the "global meaning" of `ArbitrarilyLabeled`? What control has `forgetLabel` lost?