
Why Haskell Is Worth Learning - allenleein
https://spin.atomicobject.com/2013/03/05/why-haskell/
======
kangdolit
It is worth learning, but the chances of using it for more than toy scripts
are slim. Unless your workplace has already bought into it, you'll find it a
hard sell. There are several other functional languages out there with more
vibrant communities that have useful libraries.

One selling point, the terseness/simplicity of code, can be a specious one.
Beyond the magic of map/flatmap/etc, the things that allow you to achieve
terseness in a general sense often require more cryptic constructs as
scaffolding.

One developer friend made a comment that summarizes functional languages well
in practice: "They're very useful, but try to avoid code that requires your
coworkers to know abstract algebra and category theory in order to contribute
to a project."

~~~
tathougies
> They're very useful, but try to avoid code that requires your coworkers to
> know abstract algebra and category theory in order to contribute to a
> project.

Have you ever learned a 'design pattern' in Java, Python, C++, etc? What's the
difference between learning this and learning about monoids (for example).
Monoids are super easy and actually compose, unlike the majority of design
patterns. In my experience, learning OO design patterns was substantially more
difficult than learning algebra, but I think this is mainly due to how CS
education is carried out in many universities. I feel if people start with
mainly FP, then OOP is what seems odd and necessitating learning odd, abstract
concepts, except there's the added bonus that all the abstractions are leaky.

Ultimately though, you don't even need to learn any algebra or category
theory. It was multiple years after I had already learned and started using
Haskell that I even began to become interested in these topics. My interest
was mainly piqued by a desire to not duplicate code -- it certainly isn't
required to learn algebra to understand Haskell, in the same way it's not
required to understand machine assembly to program in C++, or GPU transistor
layout to understand OpenGL.

> a general sense often require more cryptic constructs as scaffolding.

My professional experience is mainly as a Haskell dev. What is 'scaffolding'.
I don't think I've ever used such a thing.

~~~
mrob
Design patterns are usually taught by describing several example problems, and
then introducing the design pattern as something to solve all of them. The
value of the abstraction is obvious. Haskell is more often taught as though
flexible abstraction is an end in itself, and practical uses for it are
somehow distasteful. This teaching style only appeals to people who think
mathematics is "elegant" or "beautiful" instead of just a useful tool.

~~~
tathougies
Perhaps you're reading the wrong documentation. I've personally never found it
that way. Most documentation on hackage is very concrete, and for the ones
that aren't (i.e., lens), there are plenty of tutorials.

I've definitely encountered the abstraction-for-the-sake-of-abstraction types,
but those are mainly academics, in my experience.

I mean, monads are (for some reason or the other) the killer feature of
Haskell abstraction, and their use case is extremely concrete. map, fold, etc
are also motivated by very concrete desires.

Even more advanced concepts, like zippers, generics, lenses, ftpe, etc are all
motivated by _extremely_ concrete problems.

------
lordnacho
So what's a good set of examples or exercises that will show an experienced
coder some new ways of thinking?

~~~
m-j-fox
[https://github.com/data61/fp-course](https://github.com/data61/fp-course)

------
jeffdavis
The author uses "plays well with C" to mean C source code.

I tried supporting haskell from within postgres as a new language for UDFs. I
ran into many problems, but perhaps those were more with GHC than haskell
itself.

------
jeffdavis
Haskell would be great as a data language. With some good relational libraries
it could be an interesting alternative to SQL.

------
kowdermeister
> Not including the type signatures, that’s just 4 lines of Haskell!

Yeah + years of learning it, but that's not showing up as code. I'm glad he
can express that in 4 lines. I'm still not convinced this is a good investment
of time. I use functional style in JavaScript, but that's probably the
farthest I'm willing to take it at the moment.

> “Do you want to be locked into tricycles because they’re easy to learn?”

That would be great ending quote if the next step he suggest wouldn't be a
Penny-farthing.

