Hacker News new | ask | show | jobs
by clux 4603 days ago

  What's not to like?
Cabal, which unsurprisingly is not mentioned. Dependency hell makes it stupidly difficult to rely on other people's code on a large scale. I'd rather write uglier code in JavaScript if it means having access to other people's packages immediately and without complications.
2 comments

The latest version of Cabal (1.18) includes built-in sandboxing support, which alleviates this problem to a significant extent. Prior to that, there were/are tools [^1][^2] for doing the same thing external to Cabal itself. Dependency hell has without a doubt been problematic with Cabal, but it is fast becoming a solved issue.

[^1]: http://hackage.haskell.org/package/cabal-dev [^2]: http://hackage.haskell.org/package/hsenv (Disclosure: I am the current maintainer of this project, though I am happy to see it becoming obsolete)

I did use cabal-dev, and it only moved the problem from being a global problem to a local one. Is the problem that you cannot have several versions of the same package solved? Because this really needs to work, otherwise you effectively have a limit on how many modules you can use sensibly without expecting things to break.
You can have several versions of the same package. You can't have one package built multiple times to depend on different versions of the same package. This is the main cause of dependency hell.
Also, after a week I still didn't understand its type system completely.

It may be that I am simply too dumb, or that I didn't find the right resources, but 'easy to learn' this language is not.

Haskell is really not much more strongly typed than Java, or even C++ (although it's much less liberal with letting you cast than either of those languages). Just like those languages, if a function has been declared to use types a, b and c, then you'd better supply types a, b, and c as arguments. This is the same. The only real extension that I can see is the ability to create functions which accept or return arbitrary types, like `foo :: a -> [a]`, which isn't an option in Java or C++ without some hackery. Of course there are type classes and algebraic data types and other things as well, but I don't think they really make the language "more strongly typed," just more expressive in their types.

What makes Haskell a little challenging in the beginning is its currying, which means you don't need to call a function with all of its stated arguments, and the fact that function application associates to the left; i.e. that `f x y` is the same as `(f x) y`, NOT `f (x y)`, which is closer to how it would be in, say, Ruby or CoffeeScript. There are very good reasons for this, but it does take some getting used to. Currying and associativity rules are responsible for a lot of seemingly incomprehensible type errors. You get better at avoiding them as time goes on. I feel that the weirdness of reading Haskell DSLs, like Parsec, which often make heavy use of customized operators, or do-notation, is an extension of these issues, since most of the difficulty comes from trying to figure out how the types propagate through what amounts to be long, complicated chains of function applications.

If you're stuck, asking questions on the Haskell irc channel on freenode is a great way to get feedback. Learning new things is a social process, not something to be done in a padded room. :-)
The worst thing to do when learning Haskell is to think that you will be comfortable in just a week. Learning Haskell for most is like relearning to program. It takes time to build up intuition and understanding of the language. I know that it took me multiple tries at Haskell over a few months before it finally "clicked" for me and became comfortable to work in.
The type system is considerably more sophisticated than most languages we're accustomed to.
The problem is you only waited a week. Haskell is so different from the most popular languages you should approach it like you're learning programming for the first time.
Rome wasn't built in a day! Learning a new language in a week is not an easy thing to do. The reason other languages seem a lot easier to learn (Python, Ruby, etc.) is that those languages are all fundamentally similar to one another; Haskell is not.
I'm learning too. Btw, which resources are you using?