Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm running pretty fast and loose here, but you can see objects as being ADTs defined by their eliminators [0] while constructors produce new forms and their relevant type information. Eliminators can do that as well (in negative positions), but I want to drive home that a lot of what feels weird about Haskell comes from the effects of working with constructors/pattern matching. A similar comparison might be made between case classes and "regular" classes in Scala, but I don't know Scala as well.

[0] http://www.cs.ox.ac.uk/jeremy.gibbons/publications/adt.pdf



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: