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

From the wikipedia:

> The expression problem is a new name for an old problem. The goal is to define a datatype by cases, where one can add new cases to the datatype and new functions over the datatype, without recompiling existing code, and while retaining static type safety (e.g., no casts).

Why should I care about recompiling? That's an implementation detail.

Taking the compilation stuff out, it looks very similar to classy lenses.



> Why should I care about recompiling? That's an implementation detail.

Sometimes you don't have access to 3rd party src code you call into, hence why you can't always modify and recompile it.


Does that mean Kotlin's Extension Functions solve it?


Its more about the modification rather than recompilation.


But type classes solve the modification problem. (Even tough no language that I know of solves the recompilation.)


I think it's more about not being able to recompile third-party library code than your own code.


I don’t know. Don’t ask me, ask Wikipedia.




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

Search: