In practice, it’s actually rather hard to put yourself in that situation unintentionally. My point is more that global uniqueness isn’t guaranteed, not that it’s hard to achieve :)
If a Haskell library implements orphan instances, I typically put it in the "not useful" basket and get on with it. This is a satisfactory optimisation. If a Scala library does it, and it is increasingly the case, I roll me eyes, get over it and accept all the penalties.
-
-
This assumes that you have access to the code and are willing to audit it. If the instances aren't exposed explicitly but do nasty things like my ins and ins' example, you won't observe the problem until runtime, when your code does impossible things.
-
My point isn't that you should - it's reasonable to assume that most sane libraries don't do that, and if they do, it's a bug. It's ok to depend on libraries that have bugs, provided you can work around them. My point is, again - no guarantee. This is a possible bug.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.