News for hackers. Stuff that matters.
Re:Structuring Arrays with Algebraic Shapes by noelwelsh on Saturday June 28, 2025 @03:02AM (#44402803)
Records are a logical and. A cat is a name and an age and a color, for example.

A variant is a logical or. A pet is a dog or a cat.

And and or are duals.

Much more in the "Algebraic data types" chapter at https://scalawithcats.com/

Does that answer it?

Re:Structuring Arrays with Algebraic Shapes by FjordWarden on Saturday June 28, 2025 @03:34AM (#44402888)
Ok, sum types and product types
Re:Structuring Arrays with Algebraic Shapes by noelwelsh on Saturday June 28, 2025 @04:45AM (#44403196)
Yes.