4 ms·
> Haskell allows me to write code I can reason about in an equational fashion. Scala does not. That's just non-sense. In Scala typeclass instances are just par
by frowaway001 13y ago
> Haskell allows me to write code I can reason about in an equational fashion. Scala does not.
That's just non-sense. In Scala typeclass instances are just part of the equation. That's just not a big deal at all.
> Personally, when it comes to GHC's type system extensions, I am rather conservative: MultiParamTypeClasses, FunctionalDependencies, GADTs, TypeFamilies (only for associated families, never for "free-floating" families), RankNTypes.
LOL. I guess that's a joke, right?
> I find antimodularity (due to instance uniqueness) annoying, but incorrectness freaking scary.
There is no incorrectness. The code you have written does exactly what you have specified. Don't blame the tools for writing bad code. :-)
Haskell providing you the tools to easily corrupt your runtime, now that's what I call "freaking scary incorrectness".
> I want the language to help me write correct code, and implicits do not help.
Then why do you fight the language so much in your code example?
I can write terrible code in Haskell, too. Does that prove anything? No.
- catnaroek 13y ago> That's just non-sense. In Scala typeclass instances are just part of the equation. That's just not a big deal at all. The important part of the equation that Scala misses is that, when a value V has a type T that is an instance of a type class C, then V has to respect the laws associated to C. Granted, this is not enforced statically (because it requires dependent types), but instance uniqueness allows you to confine all the manual testing/enforcement to the point where the instance is defined. > LOL. I guess that's a joke, right? No OverlappingInstances, no UndecidableInstances, no ImpredicativeTypes, no DataKinds, no PolyKinds... sounds fairly conservative to me. > There is no incorrectness. The code you have written does exactly what you have specified. Dereferencing a dangling pointer is undefined behavior, and in particular, it may cause a segfault. Just as specified. > Then why do you fight the language so much in your code example? I can write terrible code in Haskell, too. Does that prove anything? No. This kind of argument I expect from dynamic language folks, not from Scala proponents.
- frowaway001 13y ago> when a value V has a type T that is an instance of a type class C, then V has to respect the laws associated to C And that's exactly what happens in Scala if you cared to look at actual code. The only difference is that one can associate different values with different typeclass instances. If you decide not to associate values with specific typeclass instances and instead write code which accepts arbitrary instances, despite the fact that the values invisibly depend on a specific one ... sorry, that's just plain dumb. That's like writing an API which accepts numbers and an arbitrary operation on those numbers, but only returns reasonable results for addition; and then complain that your code is fine as long as the "arbitrary operation" is addition. No compiler on this planet can fix a lack of brain cells. > Dereferencing a dangling pointer is undefined behavior, and in particular, it may cause a segfault. Just as specified. If you can't see the difference yourself, I can't help you. > This kind of argument I expect from dynamic language folks, not from Scala proponents. Yeah, sorry. Haskell users know how to deal with different programming languages, but the latest influx of HN's "I-read-something-about-Haskell-on-the-internet-a-few-minutes-ago-let's-tell-everyone-how-dumb-they-are-to-show-my-new-intellectual-superiority-as-a-Haskell-expert"-kids has muddied the water a bit and caught me a bit off-guard, because I usually deal with thinking people only.
- catnaroek 13y ago> And that's exactly what happens in Scala if you cared to look at actual code. My example notwithstanding? Heh. > If you decide not to associate values with specific typeclass instances and instead write code which accepts arbitrary instances, despite the fact that the values invisibly depend on a specific one ... sorry, that's just plain dumb. I am not disagreeing that it is dumb. I am complaining that the language allows me to do something that is dumb in first place. This is attitude towards correctness (the language washing its hands of having to deal with it) is what I dislike. > If you can't see the difference yourself, I can't help you. There is no difference. In both cases, an undesirable behavior is possible because of a hole in the language's design. > Yeah, sorry. Haskell users know how to deal with different programming languages Yes, exactly. The way I deal with Scala is to not use it.
- 13y ago