News for hackers. Stuff that matters.
Re:The type system is a programmer's best friend by hither_shores on Saturday November 05, 2022 @01:36PM (#33483626)
> this is a classic case of not needing more types but needing proper names.

Those are types.

Re:The type system is a programmer's best friend by Barrin92 on Saturday November 05, 2022 @03:51PM (#33484951)
no. 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.

Re:The type system is a programmer's best friend by hither_shores on Saturday November 05, 2022 @04:11PM (#33485148)

     newtype ArbitrarilyLabeled x = ArbitrarilyLabeled x
     
     forgetLabel :: ArbitrarilyLabeled x -> x
     forgetLabel (ArbitrarilyLabeled x) = x
What's the "global meaning" of `ArbitrarilyLabeled`? What control has `forgetLabel` lost?