3 ms·
I find the type system and the errors difficult. The basics are easy (like you would use in Elm for example) but once you are talking about types that are relat
by quickthrower2 6y ago
I find the type system and the errors difficult. The basics are easy (like you would use in Elm for example) but once you are talking about types that are related to other types, GHC extensions and all that, I quickly run into inscrutable errors that might take 1-2 hours of Googling to resolve.
Basic Haskell is lovely though. It's why I liked Elm initially although it does take it a bit too far in the basic direction.
The problem with Haskell is it's purity and thirst for abstraction means more and more complex type definitions and ideas - monad transformers (yes I know they are supposed to be 'easy') - and GADTs for example. And if you want to use libraries, you need to get these concepts to merely be able to read the example code. It's table stakes like known what "npm i" means when looking at a node module doco.
Javascript on the other hand, for all it's warts, allows you to cheat by wrangling directly with the data. This has a lot of issues but it is a lot easier to grok - to the point where non programmers use it as a scripting language. Sometimes people do some weird shit with proxies/promises - and you'll get that type of code in any Turing-Complete and useful language, but on the whole most libraries do keep it simple and scrutable.
- sfvisser 6y agoGHC's type errors can be daunting, but the complexity of the errors usually scales quite linearly with the complexity of your code. That's good, it keeps you in line. > The problem with Haskell is it's purity and thirst for abstraction means more and more complex type definitions and ideas [...] If that's the case something goed wrong. Proper abstraction means having complex definition with simple types!