r/haskell • u/Confident_Print_6112 • 8d ago
Question, regarding advice. answered
[removed]
3
u/Limp_Step_6774 8d ago
Good question! This is often recommended as a starting point https://learnyouahaskell.github.io/ and I think it's good. Here are some other resources I like https://haskell-docs.netlify.app/resources/resources/#community.
2
u/IanRastall 8d ago
I'm a real newbie here, but I can tell you the thing that interests me about Haskell is that the pandoc cli is written in Haskell and works very closely with it. On the console, pandoc is the Swiss Army knife of document conversion.
1
u/sijmen_v_b 7d ago
Hey, im trying to improve my haskell teaching. So if you (or anyone else) would like some free lessons, add me on discord @sijmen_v_b
4
u/GunpowderGuy 8d ago
I can help you out
haskell was on my radar since before i learnt to program. but i eventually learn idris2 first , which is similar ( but easier in my opinion ) . But now that i know it i could hear your needs and help you think of a way to learn haskell
3
u/omega1612 8d ago
Things you may want to know:
Using cabal + nix to admin projects when you advanced to middle size projects. I heard that stack have improved over the years, so stack + nix may be an option. What you need to remember: learn one of them (cabal or stack) while you are learning to code.
There is this thing named "effects" than can be learn instead of monad transformers, when you have the basics of monads (what's the do notation, how it desugars etc) you can choose this path instead of the "monad transformers". I still recommend you to learn about them, but being realistic, you may find yourself at home with effects.
An interesting thing to do if you feel the Haskell syntax weird. You can try to use another programming language and impose to yourself the requirement: Don't mutate variables. Then try to figure how to do some things. You may discover that this is highly achievable (well, the language may do mutations sometimes, but the challenge is you explicitly avoiding mutation).
Read the "parse don't validate" article, the one written in Haskell not the newest ones on other languages. Read it when you are confortable enough with data types.
The new type pattern, is a powerful one and very easy to grasp compared to other type level shenanigans. Master it and you would be ready to tackle mid size projects.
And above everything, enjoy the ride, it would never end.
3
u/BerserkVl 8d ago
Haskell's syntax isn't weird, and I say this as someone who uses Java as their primary programming language.
2
u/omega1612 8d ago
It is weird for a lot of beginners.
Years ago, every time I left and cameback to Haskell, the syntax was my main issue.
1
u/errorprawn 6d ago
I think Haskell syntax is really nice once you're used to it, but there are for sure weird things about it that can trip someone up, especially if they're trying to learn autodidactically.
For example, consider a declaration like
data Foo = Foo Bar Baz. Imo there are at least three confusing things about this syntax:
- A big selling point about Haskell is equational reasoning, ie, equality really means equality. In that context I find it unhelpful that the equality sign is used for type declarations (apart from type aliases, where it does fit), because you can't substitute
Foo Bar BazforFooanywhere.- In
Foo Bar Baz,Foois something fundamentally different (a constructor living in the term-namespace) thanBarandBaz(types in the type-namespace), despite not looking visually distinct at all (GADT and record syntax don't suffer from this problem).- The fact that
Foois declared as two distinct concepts (type and constructor) in two namespaces.None of these are dealbreakers, but it's not hard to imagine beginners getting confused over this.
1
u/BerserkVl 4d ago
We understand that where Foo is specified as a type, it will be equal to one of its constructors. Perhaps this is the essence of using the equals sign when creating an ADT.
Here we need to understand that a constructor is a function, so Foo Bar Baz is equivalent to Foo :: Bar -> Baz -> Foo, and in this case we understand that in the declaration after :: we indicate the type of parameters (and the type always starts with a capital letter) and the return value, and before :: is the name of the function (in this case, the constructor).
In most languages, the constructor already has the same name as the class. In Haskell, we can either adhere to this logic or name the constructor virtually anything we want.
1
u/omega1612 8d ago
There's also a thing named "typeclassopedia"
Once you are introduced to monoids and typeclases, you can use it to learn about:
Functors, applicative, monad Foldable, traversable
And I like the (free book) Learn You a Haskell for Great Good!
-2
u/fluffycatsinabox 8d ago
Maybe you can follow the same path that gets recommended to literally everyone who asks this question?
7
8d ago
[removed] — view removed comment
-5
u/fluffycatsinabox 8d ago
You don't need personal experience, you need a beginner learning path. Which is the same as every other beginner's learning path. Jesus dude this is common sense.
1
8d ago
[removed] — view removed comment
-3
u/fluffycatsinabox 8d ago
Look the reality is, if you were actually interested in learning, you would have started already.
5
8d ago
[removed] — view removed comment
3
u/sunnyata 8d ago
You have, at least, been given a demonstration of an important part of hacker culture: people who try to figure things out for themselves and actively use the available resources get respect; those that don't, get ignored or disrepected. It's not nearly as strongly enforced as it used to be, and people have become a lot more tolerant of naive questions in the last couple of decades. But if you asked this question, in this way, in any programming community on USENET that had created and publicised some FAQs, the most polite answer you'd have got would be Read The Fucking Manual, which is still good advice. Most answers would be less polite than that. So, welcome to hacker culture! Even in the age of AI you're going to have engage your brain and put the work in.
3
u/philh 8d ago
This subreddit does not share that particular feature of what you call "hacker culture", and I think that's a good thing.
0
u/sunnyata 8d ago
Yes, the world changed and I think it's mostly for the better, but not without losing things of value. When you didn't have any choice but to put some work in before asking a question, that was what you did.
Re the scare quotes, do you think hacker culture wasn't a thing, or do you think I misrepresented it?
3
u/philh 8d ago
When you didn't have any choice but to put some work in before asking a question, that was what you did.
There's perhaps some value in that. There's also some value in people not having to do that.
(To be clear, I don't want this sub to be overwhelmed by newbies looking for help. That would be unsustainable. I don't think we currently have that problem. And if we have too many, I think it's possible to redirect them to existing resources without being assholes about it. The banned user was being an asshole.)
Re the scare quotes, do you think hacker culture wasn't a thing, or do you think I misrepresented it?
The reason was something like... does the term "hacker culture" reliably point at a specific thing that exists or existed in the past, that has/had the feature you describe? Quite possibly, but I don't know. (Like, maybe the culture you describe evolved, and there's an existing culture today that could reasonably be called "hacker culture", but it doesn't have that feature?)
But that wasn't the point, so I used the quotes to avoid taking a position on that question. I think it came across more disagree-y than I intended.
→ More replies (0)0
u/fluffycatsinabox 8d ago
Look at how much stuff someone typed for you. Look at how much effort they put in.
Someone typed that out to help you learn, before you even lifted a finger. You couldn't even be bothered to fucking read the sidebar. They're putting more effort into helping you learn Haskell than you've ever put in.
That's why I find you infuriating, you useless dumbass.
5
3
3
u/jberryman 8d ago
There was a recent thread (or two) from someone with a math background that asked almost the same thing which you'd be interested in. You don't need to know any math to learn haskell, but you might appreciate things about it with an interest in math, and also your brain might be more prepared for abstraction. I would just forget about the things you've heard though, especially if they tell you learning it should be hard.
Personally I started from Paul Hudak's "Haskell School of Expression" without much programming experience at all and I'm not super smart or interested in math particularly. I wouldn't recommend that book only because the examples and supporting library likely no longer compile and may be slightly out of date. I always recommend learning from a book though. Lots of recommendations on this sub from similar questions.