Hacker News new | ask | show | jobs
by lomnakkus 3726 days ago
AFAIUI modular implicits don't give you global uniqueness. While this can be "worked around" in some cases[0], it's not really possible in the general case, and global uniqueness is pretty essential for sanity when writing higher-level code[1].

[0] The paper gives set-union as an example.

[1] https://www.youtube.com/watch?v=hIZxTQP1ifo . (Sorry for throwing video at you -- there's probably a write-up somewhere, but I'm in a bit of a rush, and this was the thing that came to mind.)

1 comments

> [1] https://www.youtube.com/watch?v=hIZxTQP1ifo

Now we just need a Haskell compiler which actually bothers to provide the "pretty essential for sanity" for global uniqueness. Currently, I count zero compilers in common use which do.

Not sure what you mean. Could you elaborate?
GHC gives you none of the guarantees Kmett keeps boasting about.
How so?

(EDIT: Just to forestall the inevitable: Yes, there are some weird and dangerous extensions you can enable, but mostly it's pretty clear that they're dangerous. It doesn't seem to be a problem in practice.)

> How so?

Because they never bothered to actually implement the checks to guarantee global uniqueness in GHC?

> (EDIT: Just to forestall the inevitable: Yes, there are some weird and dangerous extensions you can enable, but mostly it's pretty clear that they're dangerous. It doesn't seem to be a problem in practice.)

No weird and dangerous extensions in use. Vanilla Haskell.

> Because they never bothered to actually implement the checks to guarantee global uniqueness in GHC?

Sure they did. Orphan instances are detected by the compiler.