
The Haskell user experience - liangzan
http://rickdzekman.com/thoughts/the-haskell-user-experience/
======
david-given
My experience with learning Haskell was:

When it works, it's magical. Finally realising that monads allow little
bubbles of cause-and-effect. STM, which is utterly magical. Realising that not
having side effects is freeing, not restricting. Collapsing huge chunks of
code into little bits of pattern matching. Finding myself casually using a
higher-order type because it was the easiest way to solve a problem.

When it's warty, it's really warty. Namespaces... oh god, namespaces. About
three different rather poor ways to handle exceptions. A billion little
unmemorable functions with symbolic names. Total lack of debugging tools.
Trying to find where an a out-of-bounds list error was happening. Trying to
debug a memory leak caused by insufficient strictness --- why do I need to
care about this? The runtime should just take care of it for me; the whole
point of a lazy language is that I shouldn't have to care when evaluation
happens.

Some of the warts are just embarrassing, and need fixing ASAP. Lack of
information on a runtime exception is the biggest. Even BASIC would at least
give me a line number!

~~~
outworlder
> A billion little unmemorable functions with symbolic names

Pretty much. If you though Common Lisp was bad, this is much worse. And that
makes for a major (re-)learning curve every time you stop programming in
Haskell for a couple of months.

~~~
sknuds
It'd be nice to be able to search by type declaration

~~~
dllthomas
Hoogle lets you do exactly that, with fuzzy matching:

[https://www.haskell.org/hoogle/?hoogle=a+-%3E+[b]](https://www.haskell.org/hoogle/?hoogle=a+-%3E+\[b\])

It's as useful as you might hope!

~~~
anthk
I am not a Haskeller, but you can use "!h searchterm" on Duck Duck Go.

~~~
ddellacosta
OMG thank you, this was the thing that got me to finally permanently set my
toolbar search in FF to Duck Duck Go...

------
marcosdumay
Haskell has all the features of languages that become mainstream and mandated
top-down on workplaces. I wouldn't be much surprised if in a decade people
start complaining about Haskell-shops they way we complain about Java-shops
now. (But then, no language could get there without a marketing budget...)

Haskell lets big teams collaborate very well, makes it hard to bad coders to
destroy an entire project, consist in a good enough filter so that HR won't
hire obscenely bad developers, gives enough space for software architects do
their thing, and gives plenty of objectively measurable points to make
managers happy.

That said, it's completely immature. Haskell lacks packaging, environment
tools, and even a complete standard library (hell, I had to put a package[1]
at Hackage because no available TLS library would work!). It has all kinds of
interesting advanced features, but the basics are simply missing.

[1] [http://hackage.haskell.org/package/uniform-
io](http://hackage.haskell.org/package/uniform-io)

~~~
Arnor
That package looks useful. Thanks for sharing!

~~~
marcosdumay
Just keep in mind that it's not very mature. In particular, expect the TLS
settings to change in the future.

------
baldfat
Personally I switched from learning Haskell to learning Racket and couldn't be
happier. On the other side of banging my head I think Cabal is the biggest
disappointment of my experience and it was the worst package management
headaches for my own private builds.

Now that I am done with a book of Haskell and being a total hack at Haskell
with very little skills (I did learn quite a bit of Lambda Calculus along the
way) I think there is a BIG reason why Haskell has not grown in popularity in
language usage and is beat by Scheme and almost beat out by ML. The experience
pales to the praise and mind share in the vocal community of Haskell users.

~~~
Ixiaus
Your comparison isn't sound. LISPs and MLs are as close together as Apples and
Oranges on the functional family tree.

Cabal has its problems and it primarily stems from a lack of any good "this is
how you should use it" guides. Cabal is not a package manager!

I cannot force you to like something but I will say this in the hope that you
re-evaluate your judgement: if you still think Racket is a much better
experience than Haskell and its ecosystem, you likely haven't experienced
Haskell in-full. I know both languages and I've used both in production
software (including many other functional languages) and I can say without any
doubt in my mind that I will never select Racket over Haskell for writing
software, if presented the choice.

Are there glaring warts in the language? The ecosystem? The tooling? Sure,
nothing is perfect and one can easily point out many more warts in other
technologies that are far more popular.

~~~
baldfat
RPL has been the one killer feature for my choice of Racket. I wanted to learn
Functional programming and do a few scripts. Just after reading a book and a
half and trying to get a few things done I really liked Racket when I went
through a MOG on Programming Languages on Coursera. It went from ML to Racket
and it just clicked for me.

------
tdees40
Stack is great, but the public beta only started on June 9th. Stick with it,
and I think it will solve many of the package management problems.

------
TazeTSchnitzel
The Haskell Platform obscuring Cabal's existence bit me. I didn't know how to
use Cabal, so for a while I didn't install any packages, or know the correct
way to build them.

~~~
gohrt
That's intentional and good. Bleeding-edge packages are a headache to manage,
due to complex dependencies. You should really wring everything you can out of
Platform, and feel like an advanced Haskell programmer, before dealing with
Cabal.

~~~
thesteamboat
I think that sentiment adds to the list of things that make it hard for
someone to go from an intermediate level of skill to advanced level of skill.

------
zelos
What I'd really appreciate (as one of those people who's read LYAH and is
struggling to get going with real code) is a Haskell equivalent of Effective
Java or Effective C++.

~~~
kqr
Not sure if it's relevant, and unfortunately it's a bit outdated, but have you
seen Real World Haskell? Also related is Beginning Haskell – A Project Based
Approach.

~~~
gohrt
Real World Haskell is obsolete and is about libraries, not the language.

The "Effective" stuff is language-level lessons like:

* [http://dev.stephendiehl.com/hask/](http://dev.stephendiehl.com/hask/)

* [https://twitter.com/haskelltips](https://twitter.com/haskelltips) (someone should organize the archive)

* [http://www.slideshare.net/tibbe/highperformance-haskell](http://www.slideshare.net/tibbe/highperformance-haskell)

------
jcl
Agreed about the SEO of the documentation... I'm learning Haskell, and just
last week I was trying to parse binary files using Data.Binary.Get. I spent a
fair amount of time looking for a way to handle parse errors outside an IO
monad. It turns out that the function I needed exists (runGetOrFail), but I
couldn't find it because the first Google hit for "Data.Binary.Get" was for an
old version of the package.

I don't know how one would tell Google to prefer the latest docs, but it would
certainly help if the Hackage documentation page header warned you if you were
not looking at the latest version of the docs.

------
AnimalMuppet
> But at the end of the day I’m still a Developer in an Academic world. And
> more and more Haskell is attracting the kinds of developers who don’t know
> Lambda Calculus or Type Theory.

Haskell's ability to become a major language depends on its ability to
attract, _and keep,_ that kind of developer. There aren't enough developers
who will learn all the theory in order to learn a programming language for
Haskell to become one of the dominant languages.

------
michaelochurch
There is... certainly a learning curve. The Haskell community is still tiny.
Per capita, it's one of the best language communities out there. It just
hasn't had the thousands or millions of person-hours necessary to make
everything pretty and intuitive.

I generally say that, all else equal, and if I were to use a GC'd language--
obviously, there are projects that mandate C or other low-level languages--
then I would use: Python for a short-term (days) project, Clojure for a
medium-term (< 3 months) one, and Haskell for a long-term (> 3 months, or
multi-developer) one. You don't find yourself needing static typing if you're
doing a small, self-contained, line-of-business task like a script. You start
to really want it for multi-developer programs and for infrastructural jobs
that'll take months to complete (and, at age 32-- that's ancient in
programming years-- the only programming challenges that really interest me
are the hard ones where Haskell's type discipline pays off in a major way).

Haskell will probably never beat Python in terms of ease-of-use, and (while I
would prefer Haskell over other offerings for hard-core machine learning
infrastructure) it has a ways to go before it can take over the exploratory
data science world (we need data frames, and it's not at all clear what the
"right" way to impose type discipline on such beasts is).

All of that said, Haskell is _way_ better than it used to be in terms of user
experience. It's gone from god-awful (circa mid-2000s) to hard-but-acceptable,
and in the context of a longer-term project (i.e. at least 2 months) the
uptake is a rounding error and the pain is paid off.

Furthermore, I don't think that Haskell's opt-out approach to laziness is more
than a cosmetic issue. You can have as much strictness as you want; you just
have to ask for it. However, high-performance programming in other languages
(e.g. Clojure, Python) is also deeply technical and warty. When you start
adding type hints and using Java arrays in your machine learning code, it
doesn't look like Clojure anymore. My point in all this is that HPC is
technical and rough in all of the major languages, and Haskell's laziness is
just a small part of that.

~~~
dllthomas
_" You don't find yourself needing static typing if you're doing a small,
self-contained, line-of-business task like a script. You start to really want
it for multi-developer programs and for infrastructural jobs that'll take
months to complete (and, at age 32-- that's ancient in programming years-- the
only programming challenges that really interest me are the hard ones where
Haskell's type discipline pays off in a major way)."_

IME, this seems to be roughly, "What are the odds you'll need to refactor
significantly because the world changed around you?"

------
maest
That is a great band name.

