Hacker News new | ask | show | jobs
by riscy 3674 days ago
> Some paradigms exemplified by the special languages are arguably unrealized or aspirational. [...] Haskell's pattern matching and monads end up being used mostly as a vehicle to embed imperative programs.

Pattern matching has nothing to do with imperative programs and Haskell is not original for having it; it's been around since the 70s in ML. I would also argue that pattern matching has been realized in many popular languages (Scala, Swift, Ocaml, Rust ...)

4 comments

Agreed, and I think only someone who has not used much Haskell and has only really used the IO monad would say that monads are used mostly for embedding imperative programs. It also depends how you define an imperative program, but most monads are entirely pure and don't deal with sequencing or anything.
+1

You could argue that "Monads end up being used mostly as a vehicle to embed imperative programs", but pattern matching is a different beast. It's a joyful way to program, even for an imperative hacker like me.

I came here to say exactly this, glad to see it already mentioned. I will point out though that the destructuring aspect of pattern matching predates ML slightly with the introduction of prolog, but the mixed in/out modality paradigm of prolog's pattern matching is sufficiently distinct from ML's that ML probably deserves the credit for influencing so many modern languages.
You read it wrong. Him said that in Haskell PM & monads are using for make imperative code, NOT that is the defined trait of haskell, instead: "are arguably unrealized or aspirational"
The rest of the article lists Haskell as being original for introducing pattern matching and monads as a new programming paradigm.
Oh right. In the "Very special" section list that (Without that it could be a more compelling argument).

Perhaps haskell make it more popular?