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

I think there is no question that being able to define new types is important. I don't, however think it's clear that having to pack operations that operate on the types into the types themselves is a good idea in general. Your example is easily handled with a simple type class in Haskell e.g., and no there's it's not "essentially a class" in the OO sense, as new operations can be freely added without modifying the type itself.


Er, I've never used a OO language that didn't allow you to add new operations freely without modifying a class. Not all of them allow you to add new methods, sure, but new functions and operators are par for the course.

And surely you're not arguing the defining feature of a class is that it's closed?




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

Search: