2 ms·
Love it - very few languages come close to it. I miss it when I'm using Java/Scala/Rust/C/JS instead. But there's no way you could get a team to adopt it. To
by mrkeen 6y ago
Love it - very few languages come close to it. I miss it when I'm using Java/Scala/Rust/C/JS instead.
But there's no way you could get a team to adopt it. Too many non-Haskellers will make up claims about needing to know category theory in order to do anything. Or it's academic, or design-by-committee.
Someone commented earlier about Haskell having solutions to problems that only Haskell has, and I can give you a couple of examples:
1) Famously it has the Maybe type - instead of null - for dealing with possibly-missing values. In Haskell, if you want to chain together operations without checking for the presence of each value, you use ">>=". As many people have noted before, this is a cryptic symbol. You can just use JavaScript instead which has ".?".
2) It has mechanisms for cleaning up resources in the case you want to cancel something while it's running, notably ResourceT. Other languages take the approach where you simply cannot cancel a thread/future, thus preventing you from needing to write cleanup code in the first place.
There's also the problem of its community. Rather that accept information second-hand I invite you to read a few posts from https://www.reddit.com/r/haskell/ https://www.reddit.com/r/haskell/ and see for yourself how it treats newcomers.
I should also mention the type system. As any dynamic typing enthusiast will tell you, statically-typed languages are too verbose. And Haskell is too terse. So it kind of loses on both fronts there. You'll need to contend with people who don't like type systems because they get in your way, rather than helping you out. When I'm feeling lazy and I can't think of what to write, I just write "Int" instead and then let the compiler tell me what I was supposed to write, e.g. "Topic -> SequenceNum -> Value -> IO a0".
src/Server/Paxos/Learner.hs:41:68: error:
• Couldn't match expected type ‘Topic
-> SequenceNum -> Value -> IO a0’
with actual type ‘Int’
• In the third argument of ‘learnService’, namely ‘callback’
In the second argument of ‘(.)’, namely
‘learnService myId topicLocks callback’
In the ‘learn’ field of a record
|
41 | pure $ Learner { learn = liftIO . learnService myId topicLocks callback }
|
God knows how I managed to read that cryptic error message though.