
Advice for Haskell beginners (2017) - sridca
http://www.haskellforall.com/2017/10/advice-for-haskell-beginners.html
======
KirinDave
Addenda (relevant to community musings today):

Be aware that as a small and very distributed community, the Haskell world has
less power to eject bad actors than more centrally managed and resourced
projects have (e.g., Golang and Rust have much more structural power to
moderate). Awful and abusive people exist in the community, and it's best to
just start blocking and ignoring folks who disrespect you.

The amazing thing about the Haskell community is that knowledge is very well
distributed throughout the community these days. The culture, influenced by
academia, strongly values writing and publishing ideas rather than sharing
them orally or in the workplace. This means that if you're interested in
learning, there are a ton of places and ways to do it.

If you're looking for good initial connections to folks who are respectful,
well informed, and unlikely to expose you to some of the frustrating cabals in
the community, I've got a few recommendations

1\. Gabriel Gonzales (this is his blog, and he's @GabrielG439 on twitter)

2\. Chris Martin of TypeClasses. I'd also list his partner in crime Julie
Moronuki, but her social media interaction is reduced these days. These two
focus on helping programmers get up to speed with haskell from a variety of
starting points, and they care more about functional programming than haskell
specifics.

3\. Patrick Thompson of Github (@importantshock on Twitter). A fantastically
skilled person who will link you to a network of amazing Haskell folks who do
stuff in a positively next-generational way.

Two people who are adjacent to the Haskell community and incredibly
interesting, but probably can't answer direct questions for you. Worth a
follow.

1\. Dr. Edwin Brady, creator of the Idris language. He's widely respected,
humble, and has a beautiful vision for how humans and computers should
interact to write programs.

2\. Dr. Bodil Stokke (@bodil on twitter). Bodil is not so much a Haskell
person these days, but she's got a phenomenal breadth of knowledge and always
has interesting things to talk about in the FP space. Worth a follow if you're
on that platform.

I suppose you can ask me for help too, but I'm certainly not as competent as
these folks.

~~~
fp_learner
> Addenda (relevant to community musings today): [...] Awful and abusive
> people exist in the community

Are you referring to people saying negative things about Learn You A Haskell?

~~~
KirinDave
No. I'm referring to people like Tony Morris. There are more folks I could
name, but I think they're less obvious.

Scala's community essentially began to adopt a thinly-coded code of conduct
that said, "Don't be like Tony Morris he literally runs people out of the
scala community" it got so bad. He continues to be unrepentant and uses his
influence to fan a slow but very distressing conflict between the Cabal
community and the Stack developer community.

As for LYAH, it's a decent book. It's got its problems (in some cases it does
obnoxious and useless things like make fun of overweight people).

~~~
ad_hominem
I don't have any personal knowledge of it but I've heard that the code of
conduct you're referencing was actually created and weaponized by certain
sociopath-types to eject Tony from his own open source library in a hostile
takeover.

And not that it excuses his behavior, but I also seem to recall Tony suffering
from some very severe back injuries accompanied by chronic pain.

(Not to white knight a person I'm barely aware of but your description seems
pretty one-sided based on what I've seen)

~~~
KirinDave
> I don't have any personal knowledge of it but I've heard that the code of
> conduct you're referencing was actually created and weaponized by certain
> sociopath-types to eject Tony from his own open source library in a hostile
> takeover.

Not that I agree with this narrative, because AFAICT it wasn't true, but even
if it were? Good. That's the power and mechanism open source working as
intended. If you're a burden to the project, you're cast off. And Tony is an
insufferable burden. The code is free, and owned by the group.

The fact that he expected "ownership" of a project set up with a leadership
committee is a good example of the kind of silly behavior I'm talking about.

> And not that it excuses his behavior, but I also seem to recall Tony
> suffering from some very severe back injuries accompanied by chronic pain.

I was around for two public declarations of dramatic self harm. I'm told there
are more. And I hope he finds a way to deal with these problems, they're
serious and can be life threatening. I don't wish violence on him.

But I want him to stop making communities worse with his senseless negativity
and hostile communications. If he has problems in his life that impair his
ability to interact in this fashion, we should not enable his abusive behavior
out of charity. That's actually disrespectful, and while it may benefit Tony
in the short term, in the long term he finds himself forced out of communities
that no longer can or will bear the weight of his presence.

> your description seems pretty one-sided based on what I've seen

It's certainly one sided: it's my side. I for one ran into him a lot. It seems
like he took special delight in demanding I take his impromptu "quizzes" in
Scala and he'd hound me ceaselessly until I did. His ultimate goal was to
prove I was "not a functional programmer." He's been cut off by a lot of
longtime members of the FP community for a reason.

~~~
ad_hominem
Defending Tony Morris isn't really the hill I want to die on, seeing as how I
have no experience with the situation and I unfollowed him a long time ago to
get away from the negativity myself. I was just repeating what I heard some
prominent people mention here and there, but I guess I got a bit too caught up
in playing devil's advocate.

Thanks for sharing your unfortunate experience, and I agree that health
problems or things like that should not be an excuse to behave poorly. Take
care.

------
DonaldPShimoda
I think this (short) article had a lot of good points, though I do take minor
issue with one bit:

> Some people learn Haskell with the expectation that they will achieve some
> sort of programming enlightenment or nirvana. You will be disappointed if
> you bring these unrealistic expectations to the language.

While I have not achieved any sort of nirvana, I do believe that learning
Haskell has "enlightened" me insofar as I now look at programming in a
fundamentally different way. I put a much greater emphasis on writing many
small functions, I use types wherever possible (and type hints too, since
Python is my primary language), and I avoid side-effects when I can. All of
these things I do because Haskell taught me just how powerful simplicity can
be.

I also learned about different ways to conceptualize the relationships between
data, and I learned about laziness (something I'd never heard of before then).
Haskell has a lot to offer for people who come from an imperative background.

> Haskell is not an achievement to unlock or a trophy to be won because
> learning is a never-ending process and not a finish line.

While you can never "finish" learning, you can set milestones to mark your
achievement. Comprehending some of Haskell's features (both the basics and the
advanced ones) are perfectly acceptable milestones by which to track progress.
I don't think that's a bad thing.

\---

That said, overall the article is very good. I agree that newcomers should
write small programs, get their hands dirty, and learn to really use the basic
features of the language firsthand before moving on to more advanced things.
(And especially I agree that new users should avoid typeclasses at first, or
even at second.)

~~~
ramanathanrv
Regarding `avoid side-effects`, the amount of side-effects that are required
for a typical real problem solving code base is quite reasonably measurable.
For example, the number of network calls, DB calls, FileSystem read/writes are
are measurable. Have you been able to reduce the `side-effects` significantly
or have just become more aware of it?

When we started using ExpressJS (coming away from Java), there was a
tremendous change. As soon as you begin to code in Javascript (say from
Java/Ruby/Python world), async hits you. There is no escaping it. And the
programmer faces a tax (every time when implementing async/await or
generators), his/her awareness about side-effects (deliberately generalizing
IO as side-effects) and they tend to be more careful with it.

~~~
nightski
Avoiding side effects sounds like something someone new to Haskell would say.
Haskell in no way avoids side effects. Actually I'd say it embraces them by
introducing special semantics just for them! What it does do is encourage you
to move side effects to the "edge" of your code base and produce a more clean
separation between pure & non-pure code. This is incredibly valuable for
testing and overall correctness.

~~~
DonaldPShimoda
Right, and this is what I actually meant. It's not that side-effects
disappear, but rather that I try not to litter my code with them. I _avoid_
them in the sense that I don't embrace a side-effect-heavy style of coding, as
I did with my imperative code prior to learning Haskell.

Perhaps I could have worded that better. Sorry for the confusion.

------
ben509
I started learning Haskell by working on a proof of concept for a relational
language. The big advantage, I think, was I _didn't_ try to do anything fancy
with monads or typeclasses. I was just interesting in expressing functions,
and that got me fairly fluent in that subset of Haskell.

It definitely helped later when I started working on a language myself, and
now needed to write a parser and do a lot of transformations using uniplate.

My biggest piece of advice for beginners trying to do anything more
complicated that requires dependencies is to use stack[1] and set up a
skeleton project.

Set up your stack.yml file with the latest nightly (hack on nightlies, release
on LTS) and then visit stackage[2] to see docs _completely in sync with the
versions you're using_. You should just be able to add dependencies you need
to package.yml.

That gets you a fairly stable environment where things will actually do what
you expect, which eliminates a big source of confusion and frustration.

[1]:
[https://docs.haskellstack.org/en/stable/README/](https://docs.haskellstack.org/en/stable/README/)
[2]:
[https://www.stackage.org/nightly-2018-08-21](https://www.stackage.org/nightly-2018-08-21)

~~~
carterschonwald
Cabal newbuild is quite nice.

For newbs stack is fine. But I genuinely question any serious code base that
needs stack. Genuine cabal hell hasn’t existed since around 2010. And the mini
purgatory that some people call hell is impossivle with cabal new build.

My perspective is perhaps biased, but I also am comaintainer of widely used
libraries used literally everywhere plus I’ve done commercial and recreation
and research flavors haskell dev for over a decade, currently at a fortune
10ish sized company.

Though zooming out: these days I tell learners they should try everything out,
and revisit various tools as their mastery grows.

For industrial / large prjects that want pinned deps, I’ve seen folks happy
with the mafia build tool or even going full nix for end to end os level
reproducible build and config.

My main issue with workflows like those centered around stack is that I’ve
seen a lot of folks just not think about library versions and deps as part of
their library/application foot print. And this has various consequences in how
they engineer and upgrade their own libraries and applications.

------
LeanderK
If you're not on a purely intellctual trip, my advice is to first get a
feeling for the language before trying to understand everything. Every widely
used concept arises out a necessity and not out of thin air. Don't read all
the monad-tutorial first. It's hard to understand not only why this abstract
nonesense is useful, but even what it "is" (assuming you have no serious math
background)! The interesting thing is that the concept arise naturally if you
spend some time tinkering with haskell. The Functor arises almost instantly!

~~~
chriswarbo
Sounds like the Haskell Pyramid [https://patrickmn.com/software/the-haskell-
pyramid](https://patrickmn.com/software/the-haskell-pyramid)

------
mfonda
> Haskell is not an achievement to unlock or a trophy to be won because
> learning is a never-ending process and not a finish line.

Haskell aside, I think this is a fantastic point regardless of whatever it is
you're learning. There's always so much more to learn and having this mindset
makes it a lot easier to do so.

~~~
quiq
Reminds me a bit of the quote:

"A classic is something everybody wants to have read, but no one wants to
read." \--Mark Twain

------
nafizh
I have skimmed all the famous books so far on haskell. But the best learning
resource to me so far has been the UPenn course [0] because of the quick
coding and feedback loop in the browser. Also, the beginning assignments
involve visualizations, which is always good to check if you are doing things
right or wrong.

0\.
[https://www.seas.upenn.edu/~cis194/fall16/](https://www.seas.upenn.edu/~cis194/fall16/)

------
_bxg1
I read through part of the "Learn you a Haskell" book that was posted here
yesterday, and started getting really excited to use this beautiful language.

And then I started looking into ways to use it for making games and was...
disappointed. Maybe I've been spoiled by the vibrancy of JavaScript's
ecosystem, but I hoped to find a library for simply rendering existing meshes
with existing materials and the closest I found was a library of base OpenGL
hooks. Add onto that the lack of half-decent UI libraries (on the web you can
use Elm, which is similar but different) and it feels like the only thing
Haskell is practical for is headless data-processing, which is a shame.

~~~
wool_gather
Not exactly games, but _The Haskell School Of Expression_ by Paul Hudak is
targeted at multimedia work in Haskell. I haven't read it, but if that's what
you want to work on, it might be worth checking out.

~~~
_bxg1
I'll check it out. Mainly what I'm interested in is doing world simulation in
Haskell; it seems like it would be a really interesting language for that. But
that kind of thing isn't very useful without a decent way to visualize and
interact with it.

------
noncoml
My advice for Haskell("monad") beginners would be to try to re-implement
the("a") State monad by yourself without using any libraries. It helped me
understand that monads are nothing more than just function composition.

~~~
DonaldPShimoda
I like "Functors, Applicatives, and Monads in Pictures" [0] as a gentle
introduction to the concepts. Same revelation as yours, but through a
different vehicle.

[0]
[http://adit.io/posts/2013-04-17-functors,_applicatives,_and_...](http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html)

~~~
laurentl
[https://github.com/MostlyAdequate/mostly-adequate-
guide](https://github.com/MostlyAdequate/mostly-adequate-guide) is also
didactic but goes into more details, and is not Haskell-specific (IIRC
functors, map and so forth are all defined in JavaScript)

------
raffael-vogler
With regard to yesterday's exhumation of LYAH I'd like to point out
typeclasses.com which I just discovered on r/haskell through this
announcement:
[https://joyofhaskell.com/posts/2018-08-06-announcement.html](https://joyofhaskell.com/posts/2018-08-06-announcement.html).

------
marshray
Can anyone recommend a similar article for Rust?

