Live data from Hacker News

What I Wish I Knew When Learning Haskell

dev.stephendiehl.com

101–110 of 149 posts

Re: What I Wish I Knew When Learning Haskell

#101
post #95

Earlier quoted context omitted.

Performance. Internal representation. You are not actually modifying things in place. Those are the equivalent of linked lists not arrays. That quicksort is not quick at all because the append operation in Haskell is linear. You can't use those lists to implement quicksort.

“Modifying things in place” is, from the logical standpoint, an unnatural and even dangerous thing. A person that is not familiar with (imperative) programming often has a hard time understanding variables and assignments (similar to some programmers not understanding pointers). Mathematics doesn’t have assignments, either. That should tell you something...

In that case, quicksort requires danger and artifice. In any case, it's not quicksort.

Re: What I Wish I Knew When Learning Haskell

#102

What's up with the formatting on this page? In Firefox for iOS (same rendering engine as mobile Safari), all lines but the first one in code listings have 4-character indents, and lines use a larger-than-normal font size seemingly at random.

It might have to do with the fact that webkit is mostly a deprecated browser?

1. Firefox doesn't use webkit. 2. Webkit isn't deprecated. 3. Webkit isn't a browser.

Re: What I Wish I Knew When Learning Haskell

#103
post #58

I feel this might have grown beyond its title. Picking the point where I gave up, giving me a list of 7 vscode plugins, without any guidance as to which are more mature, doesnt feel like a thing anyone would wish to know before they start.

The VS Code plugin listed (haskell-ide-engine, https://github.com/haskell/haskell-ide-engine - to be more precise, it's a language server supporting many editors) is probably the one which sees the most development at the moment and comes with many of the other plugins listed or equivalent functionality (syntax highlighting, tab completion, linting via hlint, code formatting, refactoring) included. It certainly is th…

I would go one further and suggest people use the VS Code Devcontainer made pre-bundled with Haskell + Haskell IDE Engine installed and configured.

Properly setting up HIE was a bit of a mission:

https://github.com/hmemcpy/haskell-hie-devcontainer

This should be the #1 recommendation to anyone looking to get started IMO, it cleanly sets everything up for you and extracts it into an isolated development container.

Re: What I Wish I Knew When Learning Haskell

#104
post #50
post #36

Earlier quoted context omitted.

But let's say I want to print something in a deeply nested function which isn't of the return-IO-Monad-type. Now I have to convert the entire call-chain of functions into Monad style. Is there some tool to do this automatically?

Why would you want to print inside a pure function though?

Because some non-technical manager came to you and said, "Can't you just print out the value here? And can I get it in the next 15 minutes?" and it was pretty clear that "No" was not an acceptable answer.

Re: What I Wish I Knew When Learning Haskell

#106
post #46

Really just learn it. It's a pity I don't use Haskell at work and yet learning Haskell was the single most bang for buck exercise I have ever done. "Parallel and Concurrent Programming in Haskell" is the best resource I have ever read on parallel and concurrent programming concepts. Every programmer should learn this language even if they never plan/get to use it.

I learned Haskell and used it (and heavily functional Scala) professionally for about 6 years. I feel learning Haskell was worthless. It did not teach me anything about decomposing problems into function units, compositional sequences, pure functions / immutable data structures, lazy evaluation or asynchronous programming that I have found useful in modeling solutions to software problems. Guarantees from the compile…

>I feel learning Haskell was worthless. It did not teach me anything [..]

Did you already know most of it from Scala?

Re: What I Wish I Knew When Learning Haskell

#107
post #87
post #67

Earlier quoted context omitted.

If I am not mistaken, Dijkstra advocated for Haskell to be used as a language of instruction at universities. There is an essay somewhere online about it. What I could find is this: [1]. Edit: Indeed, the PDF that is linked to in [1] looks like a scan of the original. [2] [1] https://chrisdone.com/posts/dijkstra-haskell-java/ [2] http://www.cs.utexas.edu/users/EWD/OtherDocs/To%20the%20Budg...

> Colleagues from outside the state (still!) often wonder how I can survive in a place like Austin, Texas, automatically assuming that Texas’s solid conservatism guarantees equally solid mediocrity. My usual answer is something like “Don’t worry. The CS Department is quite an enlightened place... Very Dijkstra to start by insulting the intended audience. Wonder if it had the intended effect?

I don't see the insult? He's saying that anyone who assumes that the CS program was mediocre is mistaken

Re: What I Wish I Knew When Learning Haskell

#108
post #46

Really just learn it. It's a pity I don't use Haskell at work and yet learning Haskell was the single most bang for buck exercise I have ever done. "Parallel and Concurrent Programming in Haskell" is the best resource I have ever read on parallel and concurrent programming concepts. Every programmer should learn this language even if they never plan/get to use it.

I learned Haskell and used it (and heavily functional Scala) professionally for about 6 years. I feel learning Haskell was worthless. It did not teach me anything about decomposing problems into function units, compositional sequences, pure functions / immutable data structures, lazy evaluation or asynchronous programming that I have found useful in modeling solutions to software problems. Guarantees from the compile…

This is my same experience except with Clojure. It’s pretty much equivalent to well written JavaScript. Actually no, the latter is usually cleaner and clearer.

Re: What I Wish I Knew When Learning Haskell

#109
post #2

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

I see a lot of people below saying to chose a functional language other than Haskell. As someone who's currently learning Haskell, I'm finding it _incredibly_ interesting...but I've heard that many of the free online resources don't lay the necessary foundation for learning the more advanced concepts.

I'm 6 chapters into Haskell Programming from First Principles [0], and I highly recommend it.

[0] https://haskellbook.com/

Re: What I Wish I Knew When Learning Haskell

#110

Earlier quoted context omitted.

I learned Haskell and used it (and heavily functional Scala) professionally for about 6 years. I feel learning Haskell was worthless. It did not teach me anything about decomposing problems into function units, compositional sequences, pure functions / immutable data structures, lazy evaluation or asynchronous programming that I have found useful in modeling solutions to software problems. Guarantees from the compile…

>I feel learning Haskell was worthless. It did not teach me anything [..] Did you already know most of it from Scala?

I learned Haskell first, then Scala later for a job.
Post reply on HN