Live data from Hacker News

What I Wish I Knew When Learning Haskell

dev.stephendiehl.com

21–30 of 149 posts

Re: What I Wish I Knew When Learning Haskell

#21

Earlier quoted context omitted.

Haskell is fun, but bear in mind that it's followes a purely functional programming paradigm, meaning you either do things the Haskell or you don't do them :). But it's a fun language to learn, and there are lots of free quality ressources on the internet

> it's followes a purely functional programming paradigm I'd say that it's one take on that paradigm, the Way of Monads is not the only way to do purely functional, Clean uses uniqueness typing instead. Though it otherwise has rather similar properties to Haskell.

I'd say start with some eager functional language such as OCaml without the "object" part. Haskell code is hard to debug cuz you can't rely on good old print.

Monad itself is never a silver bullet. Type systems and Composability are the true power of FP IMO.

Re: What I Wish I Knew When Learning Haskell

#22
post #2

Great timing. I was just pondering what functional programming language I should attempt to learn in all my new downtime.

I tried to learn FP multiple times by learning haskell. Never clicked, tried clojure and I was productive after roughly 2 days.

Re: What I Wish I Knew When Learning Haskell

#23

Earlier quoted context omitted.

What do you mean by "either do things the Haskell (way) or you don't do them"? Isn't that the same with every language? I still don't understand why people put all sorts of unfair labels on Haskell. By labelling Haskell with "fun", we almost make it sound like it can't be used in production.

I imagined it was more in the sense of the 'Have fun implementing Quicksort!' variety, where you're fighting the language constructs, basically, to do what you want.

Haskell has a huge catalog of libraries you can reach for, so you don’t have to reinvent the wheel. That said, the Haskell way can seem very different than what you see in most languages. As an example, IO—or anything causing a side effect—has to happen in the IO Monad. There are good reasons for this, but it takes some getting used to.

Re: What I Wish I Knew When Learning Haskell

#24

Earlier quoted context omitted.

> it's followes a purely functional programming paradigm I'd say that it's one take on that paradigm, the Way of Monads is not the only way to do purely functional, Clean uses uniqueness typing instead. Though it otherwise has rather similar properties to Haskell.

I'd say start with some eager functional language such as OCaml without the "object" part. Haskell code is hard to debug cuz you can't rely on good old print. Monad itself is never a silver bullet. Type systems and Composability are the true power of FP IMO.

Debugging declarative code is always hard, whatever the language. Haskell does allow you to use trace expressions which will output values to standard out, see Debug.Trace.

This is no reason to avoid arguably the most popular (and state-of-the-art) function language and implementation out there.

Re: What I Wish I Knew When Learning Haskell

#25

Earlier quoted context omitted.

I imagined it was more in the sense of the 'Have fun implementing Quicksort!' variety, where you're fighting the language constructs, basically, to do what you want.

Haskell has a huge catalog of libraries you can reach for, so you don’t have to reinvent the wheel. That said, the Haskell way can seem very different than what you see in most languages. As an example, IO—or anything causing a side effect—has to happen in the IO Monad. There are good reasons for this, but it takes some getting used to.

The parent poster is not lamenting that Haskell lacks a trivial sorting function.

They are lamenting that implementing a trivial sorting function in Haskell is difficult.

Re: What I Wish I Knew When Learning Haskell

#26
post #12

Earlier quoted context omitted.

I'm sure you are right. That is just picking at one thing I will admit, but I do use vscode, so when I saw a section about how to best use haskell in vscode i was interested. I'm not interested enough, or as a beginner qualified, to evaluate 7 options.

The IDE problem is still a major pain in Haskell. However, for now there are just I think 2 main options to choose from, and it's fairly straightforward. Still, not everything works as expected yet. We've come a really long way in just the past 3 years with IDE stuff. I suggest you give it another try if you're still interested in diving into Haskell.

Well Leksah seems to still be an option.

Re: What I Wish I Knew When Learning Haskell

#27
post #24

Earlier quoted context omitted.

I'd say start with some eager functional language such as OCaml without the "object" part. Haskell code is hard to debug cuz you can't rely on good old print. Monad itself is never a silver bullet. Type systems and Composability are the true power of FP IMO.

Debugging declarative code is always hard, whatever the language. Haskell does allow you to use trace expressions which will output values to standard out, see Debug.Trace. This is no reason to avoid arguably the most popular (and state-of-the-art) function language and implementation out there.

I think we can all agree that debugging languages with lazy evaluation is specially hard. To effectively use Debug.Trace you actually need to add strictness and that can be fundamentally incompatible if you do intend to use the full power of lazy evaluation.

Re: What I Wish I Knew When Learning Haskell

#28
post #2

Great timing. I was just pondering what functional programming language I should attempt to learn in all my new downtime.

I tried to learn FP multiple times by learning haskell. Never clicked, tried clojure and I was productive after roughly 2 days.

For the 99%, Haskell's purpose is to teach you what to hate about your working language, not to be a working language.

https://blog.plover.com/prog/haskell/what-goes-wrong-2.html

Re: What I Wish I Knew When Learning Haskell

#29

Earlier quoted context omitted.

Haskell is fun, but bear in mind that it's followes a purely functional programming paradigm, meaning you either do things the Haskell or you don't do them :). But it's a fun language to learn, and there are lots of free quality ressources on the internet

What do you mean by "either do things the Haskell (way) or you don't do them"? Isn't that the same with every language? I still don't understand why people put all sorts of unfair labels on Haskell. By labelling Haskell with "fun", we almost make it sound like it can't be used in production.

For 99% of programmers, Haskell can't be used in production.
Post reply on HN