News for hackers. Stuff that matters.
Re:The visitor pattern is essentially the same thing as Chur... by dboreham on Thursday February 04, 2021 @10:58AM (#26026474)
Ah, very interesting thanks. I've seen sum types implemented in terms of inheritance (or fancy modern inheritance such as traits). Doesn't get you exclusive case enforcement, which imho is the thing that's actually useful here.
Re:The visitor pattern is essentially the same thing as Chur... by kaba0 on Thursday February 04, 2021 @11:15AM (#26026692)
Some languages have sealed classes for this reason.