
A founder's perspective on 4 years with Haskell - mightybyte
http://baatz.io/posts/haskell-in-a-startup/
======
radicality
Maybe someone can chime in here - I would love to be working full-time in
Haskell, but I'm having trouble figuring out just how much knowledge I need
upfront. I know I would be reasonably good at it after 2-3 months of working
full-time with some Haskell expert to keep bugging. I try to learn as much
Haskell as possible after my normal work but of course my rate of learning is
much slower than if it was my full-time job. Looks to me like a chicken-and-
egg problem. Anybody have any tips/knowledge of getting a Haskell job?

~~~
chadaustin
In my experience, it is tricky for people to learn Haskell meaningfully
outside of a team of people to explain the concepts. I'd say write a few real
programs in Haskell. Beyond that, if you find the right company, they will
hire based on general engineering skills rather than Haskell-specific skills.
When it comes down to it, Haskell is just another language with a particular
set of capabilities.

Also there are occasionally posts to the /r/haskell subreddit with job
listings.

Good luck!

~~~
lallysingh
The new Haskell Design Patterns book, I think, covers a lot of the existing
gap.

~~~
warkdarrior
The reviews seem to be quite negative:
[https://www.reddit.com/r/haskell/comments/41z1ih/haskell_des...](https://www.reddit.com/r/haskell/comments/41z1ih/haskell_design_patterns_any_good/)

------
facorreia
Interesting, but so many caveats (e.g. writing rough libraries for things like
sending emails). I find that Scala offers a better balance by enabling
functional programming while still taking advantage of a huge, mature
ecosystem including great libraries and tools.

~~~
continuational
There are libraries for sending email. He was talking about a specific cloud
API for sending email.

~~~
runeks
Last time I checked, and I did check recently, I couldn't find a Haskell
library that offered an easy way to send email using a Gmail account.
Resulting in this homegrown example, which doesn't work:
[https://github.com/runeksvendsen/restful-payment-channel-
ser...](https://github.com/runeksvendsen/restful-payment-channel-
server/blob/master/src/PayChanServer/Misc/Email.hs)

------
akurilin
Thanks for posting that! We've also been a Haskell at scale in production
company for a few years at Front Row, great to see others pulling off the same
successfully. It's a small community so I'm happy to pool our resources
together to make this continuously a better ecosystem to build businesses on.

~~~
0xmohit
Here is a link to a relevant post:

[http://www.kurilin.net/post/117369543198/haskell-at-front-
ro...](http://www.kurilin.net/post/117369543198/haskell-at-front-row)

~~~
akurilin
<3

------
Confusion
I was really disappointed by Haskell when I wrote the simple dynamic
programming solution to the knapsack problem in it. To get good performance
out of that took a lot of time and help from people at #haskell to deal with
space leaks.

Ultimately, the functional solution was verbose, harder to understand and
still slower than the more imperative solutions in Clojure (also very hard to
get good performance in BTW, but at least you can easily implement performance
critical stuff in Java) and Ruby.

That experience really turned me off Haskell.

~~~
tome
Why didn't you just write the imperative solution in Haskell?

------
Nemant
_The Better platform gets around half a million learning actions every week
and it has been running for well over a year with no downtime or maintenance.
We still don’t know of any bugs._

I'm guessing people use your learning software during weekdays and working
hours (5 days and 8 hours/day). That's 3.4QPS. How many machines are you
running on?

Also, I'm really shocked to hear you've not encountered any bugs. How many
humans are using your systems? A scale is good enough (100s, 1000s, 10000s?).

~~~
coldtea
> _That 's 3.4QPS._

Who said a "learning action" is equivalent to a query?

> _Also, I 'm really shocked to hear you've not encountered any bugs._

What's so shocking about it?

~~~
didibus
What bugs are we talking about? You've never encountered a functional bug or a
security bug? That's definitely a good track record. Bug studies on languages
definitely point to only a slight lower rate of bug for Haskell compared to
other languages, so to have none is quite an outlier.

~~~
codygman
I only know of two somewhat comprehensive studies on this. One says Haskell
had far fewer bugs and the other has a conclusion like yours.

You make it sound like there are numerous studies supporting your conclusion,
can you link a few of them?

------
nxc18
This is a great article - functional languages like Haskell don't get enough
credit in a world where JavaScript's shenanigans are the accepted norm.

Also check out F#, especially if you already have a code base involving .NET
in any way. The CLR makes it super easy to write some parts in a functional
language and other parts in more traditional OO - after all, the right
approach often varies even within projects.

As a personal anecdote, taking the time to learn Haskell or any other
functional language makes you a better programmer. The concepts often apply to
less'pure' languages and certainly stretch you to think in new ways.

~~~
jjzieve
Isn't JS functional?

~~~
catnaroek
A functional language is a procedural language that meets the following three
additional conditions:

(0) It encourages using values over objects with a notion of physical
identity.

(1) It encourages using procedures that compute _functions_ : mappings from
values to values.

(2) It discourages distinguishing between procedures that compute the same
function.

Let's see how well JavaScript fares:

(0) Are `[1,2,3]` and `[1,2,3]` equal or different?

(1) Given `function(x) { return { first: x, second: y }; }`, are `f("hello")`
and `f("hello")` equal or different?

(2) Are `function(x,y) { return x + y; }` and `function(x,y) { return x + y;
}` equal or different?

This should tell you whether JavaScript is a functional language.

~~~
minitech
[citation needed], because this sounds wrong:

> A functional language is a procedural language

this doesn’t sound authoritative:

> that meets the following three additional conditions

this doesn’t sound like the right distinction:

> It encourages using values over objects

and this doesn’t sound meaningful:

> It discourages distinguishing between procedures that compute the same
> function.

~~~
catnaroek
> this doesn’t sound authoritative

A functional language still uses procedures, even Haskell! To see what I mean,
consider the possibility of divergence (infinite loop, `undefined`, `error
"foo"`, you name it). It doesn't make sense for a mathematical function to
diverge. The difference between, on the one hand, Haskell, ML and Racket, and,
on the other hand, JavaScript, Python and Ruby, is that the former group
encourages you program with procedures that compute mathematical functions,
whereas the latter group does not.

> this doesn’t sound like the right distinction

It doesn't suffice, but it's a precondition. For good or for bad, mathematical
functions are mappings from values to values, so you can't talk about
computing functions in a language without a rock-solid notion of (possibly
compound) value.

> and this doesn’t sound like the right example for (2) [deleted from your
> original post, but I'm not deleting it from here]

Yes, it's the right example. Haskell and ML prevent you from accidentally
distinguishing two extensionally equal functions by not letting you compare
procedures in the first place.

> and this doesn’t sound meaningful

These functions ought to be extensionally equal in any mathematically
civilized language:

    
    
        function foo(x,y) { return x + y; }
        function bar(x,y) { return x + y; }
    

But JavaScript lets me distinguish them.

~~~
chriswarbo
The nice thing about infinite loops, `undefined` and `error "foo"` is that
nothing can use their result (i.e. nothing happens "after", although that's a
tricky concept with lazy evaluation!)

In other words, Haskell doesn't have try/catch for things like `undefined`, so
we _do_ have to worry about them occuring, but we _don 't_ have to worry about
them causing the code to misbehave; it'll either behave or it will stop
progressing (either halting or looping infinitely).

On the other hand, the "IO" DSL built in to Haskell _can_ do try/catch; but
once you're in IO, all bets are off.

~~~
catnaroek
Oh, I'm not saying Haskell doesn't let you express functions. What I'm saying
is that functions are expressed as procedures that compute them.

The nice thing about Haskell is that it distinguishes between procedures that
may only compute functions (or diverge), and procedures with arbitrary
effects.

------
rkrzr
Is there something like a "standard" HTTP client library and also a SQL
abstraction library in Haskell nowadays, that everyone is using? Similar to
what 'requests' and 'SQLAlchemy' are in Python?

I feel those would be the two libraries that I would probably miss the most
when switching to Haskell for a project.

~~~
moosingin3space
I've heard good things about Servant as an HTTP client library.

~~~
leshow
Servant is built on wai and warp and is more of a DSL for writing APIs.

It's a fantastic framework, but it's not an 'http client library' as such.

------
thoradam
> You might later find that something that took you 5 lines is a standard
> abstraction ready to be re-used.

Such a great point and perhaps one of the biggest challenges as languages
allow increasingly reusable and powerful abstractions. I would love to have
GHC tell me something like "this piece of code here has a signature that is
familiar, you could probably make this fit into {list of abstractions}".

~~~
runeks
Such a tool exists. I've had _hlint_ tell me many times how to do something in
a better way. At some point I had it hooked into my IDE, so it would mark
improvable code in yellow.

Especially in the first year I learned a lot of new Haskell syntax and
functions just from its suggestions.

~~~
harveywi
If you don't mind me asking, which IDE do you use?

~~~
runeks
Oh, yeah, I should have mentioned that: IntelliJ IDEA with the Haskforce
plugin. The plugin isn't maintained any longer, though, so it's not the best
solution, but it was perfect when both ghc-mod and hlint worked. ghc-mod still
works, because I can't go back to coding without it, speeds everything up so
much to have instant compiler feedback.

For example, there is this fatal, unresolved bug that no one knows how to fix:
[https://github.com/carymrobbins/intellij-
haskforce/issues/28...](https://github.com/carymrobbins/intellij-
haskforce/issues/285)

 _EDIT:_ It's working again (for projects that do not exhibit above bug):
[http://i.imgur.com/jPo4Tas.png](http://i.imgur.com/jPo4Tas.png)

------
hkjgkjy
How I wish for a lisp like Clojure with a type system like Haskell...

Hope core.typed will be that!

~~~
TheMagicHorsey
Have you looked at Typed Racket? They are doing some amazing things with rich
type systems and gradual typing. You can get the best of both dynamic
languages and statically typed ones by introducing types gradually as you
develop. I quite like their model for types.

I like Haskell also, but I feel Haskell is less readable than a lisp. But I
will concede, this might be because I have been writing lisps longer than I
have worked with Haskell.

~~~
hkjgkjy
Sadly haven't, because I have not had a reason to need it. Working with
Clojure mostly. I like how Typed Racket "carries" the types with it when code
from it is imported into other languages (like untyped Racket) via contracts.

Lisps are definitely the most readable language - and with something like
Smartparens or Paredit, combined with Rainbow-delimiters in Emacs it's the
best programming I know by very very far.

What is your experience of Typed Racket?

------
bogomipz
I am curious why the founder chose Zurich if they didn't know anybody there,
which makes me think they are from somewhere else. Isn't Zurich particularly
expensive? Wouldn't that be a detriment to a startup?

I realize the article is about Haskell but, but its also about a startup and a
founder so I thought I would ask.

~~~
solidsnack9000
Carl and Jan are from Sweden and the Czech Republic, respectively, and our
staff when I joined were a Dane, and Dutchman, a Hindu and an American (me).

There was no particular effort to integrate -- of the team, I was the only one
who regularly took lessons in Swiss German -- but it turns out that there are
several practical reasons to run a European startup in Switzerland:

* Taxation in Switzerland is fairly light, lighter even than in the United States.

* Business regulation is comparatively streamlined, and labor flexibility is relatively great.

* The tradition of efficient public services is rather relevant to any one trying to manage a small tribe of people, anywhere.

* Lots of European people would like to work in Switzerland and, unlike SF, it is possible to hire from your European network without visas.

Relative to San Francisco, Zurich is not particularly expensive.

------
structorg
I am a bit confused, lets suppose that TLS is broken in haskell libraries, or
there is some kind of thing haskell has no libraries for and you don't want to
lose time implementing it; what stops you from making a service for that task
in another language?. I fail to picture a big system that is not distributed,
maybe the problem of this startup required a monolithic system, or is it that
a monolith project is in some ways easier to manage?.

