5 ms·
whereas Haskell expects a certain familiarity with abstraction. I'm curious why you think Haskell is unique in this regard. I mean, sure, if you want to under
by zzalpha 12y ago
whereas Haskell expects a certain familiarity with abstraction.
I'm curious why you think Haskell is unique in this regard.
I mean, sure, if you want to understand why things like Monads exist, I agree, that fundamentally means grokking some pretty deep abstractions.
But I don't know that you need to understand those abstractions to use and appreciate Haskell... maybe to fully use and fully appreciate it, but I wouldn't expect that of a 10 year old to begin with, in part because I wouldn't necessarily expect that of an adult either.
- AnimalMuppet 12y agoYes, I had things like monads in mind, but also currying, and higher-order functions, and I could probably think up a couple more if I tried. True, all languages require abstractions. But it seems to me that Haskell is more abstract than most. That's it's strength, in fact. But it seems to me that it also creates something of a mismatch when trying to teach it to a 10-year-old.
- zzalpha 12y agoHuh... weird, I don't really think of currying as much of an abstraction. I mean, if you're going to be rigorous about it, maybe, but you can cheat and explain it as partial function application, which gets you 99% of the way there, and I think is pretty easy to explain. Higher order functions are certainly a bit trickier, but you could explain them in specific contexts (as with 'map') without needing to deal immediately in generalizations, which probably makes it a lot easier to explain.
- platz 12y agoI assume then you'd expect him to learn about polymorphism, inheritance, classes, the 'static' keyword, and virtual functions if this was an OO language, if these kinds of things are on the table, right? I'm sure there aren't truckloads of evidence of beginners having problems with those concepts.
- chowells 12y agoIn all honesty, inheritance, classes, the 'static' keyword, and virtual functions are all harder than anything in Haskell. They're all weird ad-hoc concepts without simple underlying mathematical concepts. That's rather unlike Haskell, where the underlying math is usually very simple, if more abstract than most people are used to.
- seanmcdirmid 12y agoThat is very subjective. For example, Lisp has a very simple grammar, yet many people find the minimalism complicated in how it manifests in paren heavy code. Likewise, Haskell's reliance on abstract mathematics is definitely going to turn many people off to it. "It's just math" is often taken as a negative, not a positive (depending on the person). Natural language is built around all sorts of non mathematical ad hoc concepts, yet we seem to use it just fine. Of course, it might not be the best way to talk to the computer, but it is definitely "accessible."
- coolsunglasses 12y agoThere's no abstract mathematics in the casual Haskell user's experience. I have no education, no background in math, self-educated or otherwise and use it effectively and happily for industrial purposes.
- seanmcdirmid 12y agoProgramming in Haskell is as close to math as one can get in a general purpose programming language (theorem provers are more so, but not general purpose). You might just have a knack for it even without formal training.
- coolsunglasses 12y ago>You might just have a knack for it even without formal training. Nah, I've attempted some real math with a tutor, I'm quite bad at math and proofs :) No skill or background needed with such things for Haskell.
- lmm 12y agoSomething as simple as "+" is already [a] a -> a -> a. Where did "a" come from? Whereas in e.g. Scala, "5 + 6" is just calling the "+" method on 5 (I can see it right there, on Int: "def +(x: Int): Int"). I also find OO polymorphism a bit more discoverable than typeclass-based polymorphism. You can look at an OO object in the REPL and see what methods it has on it, in a way that's harder to do in Haskell. You pay the price eventually of course - in Scala you end up needing more machinery to be able to treat "+" as a two-argument function, and you need typeclasses for certain problems so you end up having two different forms of polymorphism. But the tradeoff is that you can learn the less general version first and get started quicker, even if you end up having to learn more overall.
- merijnv 12y ago> in e.g. Scala, "5 + 6" is just calling the "+" method on 5 What's calling? What's a method? What's 5 that lets me "call" "methods" on it? Yeah, absolutely nothing intimidating for a 10 year old there...
- lmm 12y ago> What's calling? What's a method? No different or harder than calling a function in Haskell. > What's 5 that lets me "call" "methods" on it? A value like any other. That's how you do everything in Scala - calling methods on values. Again, I don't see how you could reasonably claim this is any more intimidating or confusing than calling a function in Haskell. > Yeah, absolutely nothing intimidating for a 10 year old there... I didn't say that; just that it's less intimidating than Haskell. It doesn't introduce confusing abstraction immediately like Haskell does. In Scala, 5 is an Int, you can click through to what an Int is and see that it has a + method on it. "Hello" is a String, you can click through to what a String is and see that it has a startsWith method on it. In Haskell, "+" comes from a mysterious faraway place and you can see that it's "a :: Num => a -> a -> a". I do think this involves not just more symbols but genuinely more abstract concepts than the Scala version.