News for hackers. Stuff that matters.
Re:What it's like to use Haskell by dllthomas on Thursday March 27, 2014 @05:45PM (#7483735)
The "direct compare" in Haskell isn't. The Ord constraint effectively passes a dictionary, and even if that were inlined in a particular case you could always apply a newtype for a different ordering.
Re:What it's like to use Haskell by acqq on Thursday March 27, 2014 @05:55PM (#7483794)
I'd really like to learn, can you please explain where the Ord constraint is, and where the dictionary is passed in the link I've given (with the STUArray -- isn't that really an array in a C sense)? To give you an idea how little I know: I understand the basic ideas of Haskell (that is, what I as a C programmer who made some compilers understand as basic: the type inference and the illusion of the infinite memory by not doing things in place but lazily with the GC unless unsafe or when it is possible to optimize the laziness out) but I don't really know the language. Thanks in advance.
Re:What it's like to use Haskell by dllthomas on Thursday March 27, 2014 @06:44PM (#7484047)
Ah, my bad, the STUArray example is specialized and probably does not pass an Ord around (though there's implicitly one present because of the less-then). Certainly, the function does not meaningfully allow the user to pick it.