Live data from Hacker News

Haskell for Beginners

blog.kalvad.com

11–20 of 46 posts

Re: Haskell for Beginners

#11
post #10

Earlier quoted context omitted.

LYAH is a great resource but it is a bit dated at this point and there have been more entries into the space. Haskell needs more content like this to show people how approachable it is, and especially when they're more up to date and more in line with recent best practices in using haskell. As long as we're not all doing burrito tutorials, the more people that engage with Haskell (and write posts about it), especiall…

So is it still worth reading LYAH nowadays? Are there any other resources that you could recommend instead of it?

I'm unfortunately not an expert in teaching Haskell but I know people often recommend Real World Haskell:

http://book.realworldhaskell.org/

It comes up quite often on r/haskell, for example:

https://www.reddit.com/r/haskell/comments/muzun2/is_real_wor...

Re: Haskell for Beginners

#12
post #10

Earlier quoted context omitted.

So is it still worth reading LYAH nowadays? Are there any other resources that you could recommend instead of it?

I'm unfortunately not an expert in teaching Haskell but I know people often recommend Real World Haskell: http://book.realworldhaskell.org/ It comes up quite often on r/haskell, for example: https://www.reddit.com/r/haskell/comments/muzun2/is_real_wor...

RWH is even more outdated than LYAH, unfortunately. I learned off Haskell Programming from First Principles, but it's since become controversial because of a falling-out between the authors.

Re: Haskell for Beginners

#13

Noob question: does it worth, for a beginner, to start with Haskell instead of Elm or Purescript?

I would recommend starting with Elm. The language is much smaller, and the error messages are best in class. The error messages from the Glasgow Haskell Compiler (GHC) are often intimidating and it takes time to get used to them. Whatever you learn in Elm will translate more or less directly to Haskell.

Re: Haskell for Beginners

#14
post #10

Earlier quoted context omitted.

So is it still worth reading LYAH nowadays? Are there any other resources that you could recommend instead of it?

I'm unfortunately not an expert in teaching Haskell but I know people often recommend Real World Haskell: http://book.realworldhaskell.org/ It comes up quite often on r/haskell, for example: https://www.reddit.com/r/haskell/comments/muzun2/is_real_wor...

Real World Haskell is unfortunately outdated - it predates the 2014 Applicative Monad Proposal.

Re: Haskell for Beginners

#15
post #9

Noob question: does it worth, for a beginner, to start with Haskell instead of Elm or Purescript?

Yes, because of the more mature literature and ecosystem. There is a reason quickcheck didn't come out of purescript.

> There is a reason quickcheck didn't come out of purescript.

One of those reasons is going to be that QuickCheck predates PureScript by 14 years.

Re: Haskell for Beginners

#16
post #4
post #2

Why not simply read "Learn You A Haskell", which is mentioned in the introduction?

He was not entirely happy with that resource: "So I read a couple of tutorials online and went through the famous Learn You a Haskell for Great Good ! It was a long and painful journey - which is not over yet. After some retrospection I wanted to share my own introduction to Haskell based on my python experience. What I wished I had learnt first and what I wished I learnt later down the road."

I personally found LYAH to be an excellent resource. One of the best programming books I've ever come across

Re: Haskell for Beginners

#17
I'll add my two cents. Over the past year or so I went from being completely overwhelmed by Haskell to feeling pretty comfortable reading / writing Haskell, even enough to make my first PR to a Haskell package! Here's what worked for me:

* I went through LYAH, but at a certain point I felt like it wasn't doing me any favors by sweeping some of the inherent complexity under the rug. So I started listening to talks by SPJ, Wadler, et al. and reading the papers they wrote in the 1990s-2000s. See for instance the SPJ talk on Typeclasses [1], the Beautiful Concurrency paper [2], and the one about Monadic Parser Combinators [3].

* Don't just read stuff, run it in GHCI, or better, learn how to set up a minimal project with Cabal/Stack.

* I spent a lot of time reading about type theory and category theory. This isn't strictly necessarily, but it gives me context and perspective on the language.

* Haskell Language Server integration with VS Code was a lifesaver. Being able to hover over an expression and see the inferred type makes it so much easier to reason about Haskell code as a beginner.

* To understand monads, it was most helpful to see how do-notation and the >>= and >> operations desugar into a sequence of lambda abstractions. In general, I tried to find as many different examples of monads as possible. Seeing monad comprehension syntax really helped as well.

* After a while, I could read Haskell, but felt absolutely lost when trying to write it myself. So, I started working on a small cli that forced me to learn stuff like: how to manage a monad transformer stack, how to make http requests, how to parse and serialize json, how to write to a database, etc.. It took months and months, and I would often get stuck and have to go and spend a few weeks learning something else. But I always had a project to come back to and apply what I learned.

[1] https://www.youtube.com/watch?v=tqx9_MQbQ_c

[2] https://www.microsoft.com/en-us/research/wp-content/uploads/...

[3] https://www.cs.nott.ac.uk/~pszgmh/monparsing.pdf

Re: Haskell for Beginners

#18

I'll add my two cents. Over the past year or so I went from being completely overwhelmed by Haskell to feeling pretty comfortable reading / writing Haskell, even enough to make my first PR to a Haskell package! Here's what worked for me: * I went through LYAH, but at a certain point I felt like it wasn't doing me any favors by sweeping some of the inherent complexity under the rug. So I started listening to talks by…

> Don't just read stuff, run it in GHCI

Newcomers should absolutely use ghci commands like :t :type https://downloads.haskell.org/ghc/latest/docs/html/users_gui... to tinker and experiment. Also :info and :instances https://downloads.haskell.org/ghc/latest/docs/html/users_gui... once they start learning about typeclasses.

Typed holes can also be really helpful https://downloads.haskell.org/ghc/latest/docs/html/users_gui...

Re: Haskell for Beginners

#19

Noob question: does it worth, for a beginner, to start with Haskell instead of Elm or Purescript?

Purescript is almost Haskell anyway. I love writing it, but it probably makes more sense to just learn the mother language first, since so many more educational resources are available.

Re: Haskell for Beginners

#20

I'll add my two cents. Over the past year or so I went from being completely overwhelmed by Haskell to feeling pretty comfortable reading / writing Haskell, even enough to make my first PR to a Haskell package! Here's what worked for me: * I went through LYAH, but at a certain point I felt like it wasn't doing me any favors by sweeping some of the inherent complexity under the rug. So I started listening to talks by…

>forced me to learn stuff like: how to manage a monad transformer stack, how to make http requests, how to parse and serialize json, how to write to a database, etc..

I am currently just before this stage. I can use Haskell for stuff like projecteuler.net problems but I haven't written a single useful, real-world program without copy-pasting some code.

I tried doing something with http requests to an API for stock trading but I failed to understand how to make a request. There are a few packages but they all have their flaws (e.g. no https) and aren't really developed that much.

My question is: did you write all these things with mostly only the Prelude of Haskell or did you use packages for all those things you listed (http requests, json data, databases etc.)?

I'd love some pointers in the right direction for http requests as well as maybe ideas for initial real-world project ideas that are exciting (I don't care for the standard ones you find online).

Post reply on HN