News for hackers. Stuff that matters.
Re:Proposing a Struct Syntax for Python by LoganDark on Wednesday June 14, 2023 @04:32PM (#36332191)
You'd need to create newtype wrappers anyway in order to tell them apart, I'd assume. Otherwise it wouldn't really be an algebraic data type as much as a... union type.
Re:Proposing a Struct Syntax for Python by masklinn on Wednesday June 14, 2023 @04:36PM (#36332235)
Hence “equivalent”. Of your variants all have trivial and non-overlapping payloads you can just use them as-is, or erlang-style tagged tuples, in most cases it’ll do fine.