Y
Hacker News
new
|
ask
|
show
|
jobs
by
eru
5975 days ago
Exactly. (However Data.Set is only defined for comparable values, i.e. the Ord typeclass, not Eq.)
1 comments
jrockway
5975 days ago
That is an efficiency hack to make it O(n log n) instead of O(n^2) rather than an intrinsic property of sets, functors, or Haskell :)
link
eru
5975 days ago
Indeed. But Hindley-Milner [1] type systems have trouble expressing commutative stuff in general.
[1] I hope I got the names correct.
link