News for hackers. Stuff that matters.
Re:Algebraic Data Types in Haskell by prionassembly on Monday March 28, 2022 @02:58PM (#30834213)
Tuples (or namedtuples/dataclasses if you must have named fields, which in Haskell too is additional syntax) are product types, enums are sum types.

You should look into functools.singledispatch if you're doing business logic with isinstance. But you should also learn about object-oriented programming, inheritance vs composition, mixins, etc. People get sour on OOP because they should have learned FP first and then imitate/translate FP idioms -- instead of doing something like modeling domain ontologies in object graphs. Likewise, people get sour on FP yadda yadda instead of trying to literally write their programs as proofs to theorems.

Re:Algebraic Data Types in Haskell by couchand on Monday March 28, 2022 @04:44PM (#30835338)
OOP is not an alternative to ADT, and a language lacking an expressive system of value types will stunt your development regardless of what flavor the rest of the language follows.