News for hackers. Stuff that matters.
Re:Types as Interfaces by randomdata on Tuesday July 23, 2024 @11:16AM (#41046866)
You could prevent arbitrary mutation, pushing computation onto a more flexible type and allowing assignment back to the more constrained type only when first guarded by an appropriate conditional. The whole "parse, don't validate" thing.
Re:Types as Interfaces by oasisaimlessly on Tuesday July 23, 2024 @01:42PM (#41048766)
The reference (an excellent read!): "Parse, don't validate" https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...