Live data from Hacker News

Pedagogical Downsides of Haskell

ciobaca.substack.com

1–10 of 118 posts

Re: Pedagogical Downsides of Haskell

#2
Brilliant write up.

> There is also a school of thought that you should start Haskell by teaching the IO monad first, but I am not convinced: in my experience, if someone gets exposed to IO early on, they will contaminate all their functions with IO. They will essentially end up writing Java in Haskell.

I don't think this is such a bad starting place. Crawling before walking. Purifying an (unnecessarily-) IO function into an ordinary function is a good exercise.

Trying to enforce non-IO from the start would be like enforcing 'no new keyword & factories only' in another language.

Re: Pedagogical Downsides of Haskell

#3
post #2

Brilliant write up. > There is also a school of thought that you should start Haskell by teaching the IO monad first, but I am not convinced: in my experience, if someone gets exposed to IO early on, they will contaminate all their functions with IO. They will essentially end up writing Java in Haskell. I don't think this is such a bad starting place. Crawling before walking. Purifying an (unnecessarily-) IO function…

I agree. Haskell is a really good imperative language if that's what you want to use it for.

And allowing beginners to write actual meaningful programs is a huge pedagogical benefit.

Re: Pedagogical Downsides of Haskell

#4
PureScript might be worth considering, a few of the downsides listed here aren't in PS, for example: Int/Number primitives aren't overloaded, strict evaluation, the various tools like package management are easy, explicit Prelude means you are free to import foldl from Array for example.

Of course PureScript has it's own downsides not apparent in GHC

Re: Pedagogical Downsides of Haskell

#6
post #4

PureScript might be worth considering, a few of the downsides listed here aren't in PS, for example: Int/Number primitives aren't overloaded, strict evaluation, the various tools like package management are easy, explicit Prelude means you are free to import foldl from Array for example. Of course PureScript has it's own downsides not apparent in GHC

PureScript also has the huge advantage that it's trivial to build "something". When teaching Haskell, I'm never sure what to build as an example. CLI tools aren't attractive, making a webserver is complex, and so is making a native UI. Of course you can use GHCJS, but at that point, why not just teach PureScript in the first place?

Re: Pedagogical Downsides of Haskell

#9
post #6
post #4

PureScript might be worth considering, a few of the downsides listed here aren't in PS, for example: Int/Number primitives aren't overloaded, strict evaluation, the various tools like package management are easy, explicit Prelude means you are free to import foldl from Array for example. Of course PureScript has it's own downsides not apparent in GHC

PureScript also has the huge advantage that it's trivial to build "something". When teaching Haskell, I'm never sure what to build as an example. CLI tools aren't attractive, making a webserver is complex, and so is making a native UI. Of course you can use GHCJS, but at that point, why not just teach PureScript in the first place?

Or use gloss and make "something" arguably more easily than in PureScript?

https://hackage.haskell.org/package/gloss

Re: Pedagogical Downsides of Haskell

#10
I find the go pattern absurd. Which of these is easier to read:

    foldr k z = go
      where
        go [] = z
        go (y:ys) = y `k` go ys
or

    foldr k z = foldr_k_z
      where
        foldr_k_z [] = z
        foldr_k_z (y:ys) = y `k` foldr_k_z ys
Post reply on HN