Comment by mrkeen
9 months ago
Hi from Haskell land!
Haskell went through this as well. Orphans used to be allowed and I certainly saw their appeal.
The problem is that the compiler might see two different implementations of ToString for MyType in different source files. The compiler could probably make a check for that if it were compiling both files at once, but if you want to be able to compile source files separately and only recompile files which have changed, etc., I think it gets harder to spot.
> someone has to hack around that with a newtype wrapper
Don't think of it as hacking around it. It's the blessed approach. Newtype wrapping is giving a proper names to the behaviours, so that they don't get mixed up.
No comments yet
Contribute on Hacker News ↗