3 ms·
>But, articles explaining the core use cases and how only this language enabled solving it are rare From my (limited) experience with Haskell, my impression is
by verandaguy 4y ago
>But, articles explaining the core use cases and how only this language enabled solving it are rare
From my (limited) experience with Haskell, my impression is that it's strongest in domains that map _very_ well to formal mathematical models. Mathematical computation is an obvious example, but things like programming language parsers are also really intuitive to build in Haskell.
My experience trying to use Haskell for other stuff — mainly, building web backends, my bread and butter back then — was painful. Simple CRUD against a database is actually pretty decent thanks to there being decent Postgres drivers and libraries, but the moment you need to handle arbitrarily-nested data structures (like a JSON request/response with a nontrivial schema), you run up against a lot of awkwardness, to the point that for the longest time this was known in Haskell as the "records problem."
Lenses and similar tools have tried to solve this problem over the years, and maybe they have, but I moved on from the language when I saw how deep that rabbit hole went.
None of this is to say Haskell isn't fun or rewarding, but it definitely has its strengths and weaknesses.
- havercosine 4y agoThanks for writing about that experience, makes sense. My first to forays in the language ended the same way. I tried to do mainstream programming stuff in it but realised I wasn't making much progress in first few days and eventually moved on.
- epgui 4y agoIt sounds like you folks didn't give the language enough of a chance and may have felt the friction of trying to write Haskell in the style of another language. It takes a while to learn how to go with the grain, in any language. While I totally sympathize with this, I'm not sure it's a very good vantage point from which to judge a language.
- pdimitar 4y agoWhich goes back to the root comment and the issue it raised: Where are the practical Haskell tutorials. No preaching, no "you're holding it wrong", ONLY this: "you need to handle arbitrarily nested JSON? here's how".
- gilmi 4y ago- Learn Haskell by building a blog generator[0] (disclaimer: I wrote this) - Simple Haskell Handbook[1] - Haskell (Almost) Standard Libraries[2] - [0]: https://lhbg-book.link https://lhbg-book.link - [1]: https://marcosampellegrini.com/simple-haskell-book https://marcosampellegrini.com/simple-haskell-book - [2]: https://leanpub.com/haskell-stdlibs/ https://leanpub.com/haskell-stdlibs/
- epgui 4y agoThis is a pretty good resource, and there are many others: https://www.amazon.ca/Haskell-Depth-Vitaly-Bragilevsky/dp/161729540X/ https://www.amazon.ca/Haskell-Depth-Vitaly-Bragilevsky/dp/16... Learning an entirely new language is hard and requires patience and perseverance!
- whateveracct 4y agoWhat?? I've gotten paid big money to write Haskell for like a decade. None of the work had anything to do with formal models. That's comically wrong. But it was good software and Haskell was a big part of that.
- kqr 4y agoI'm having trouble understanding what your actual point of criticism is. The records problem is basically a small syntactical quirk. Undesirable, yes, but not what will make or break production software development. Lenses solve some of that and much more. Lenses strictly improve on fields/records/getters/setters/etc. in any other language you know. In other words, they accomplish what they do and then some. If that was your only problem with Haskell, then it might be one of your favourite languages if you get to know it again.
- verandaguy 4y agoThat was the most memorable issue I had with Haskell; thinking back, other stuff that bugged me was some of the idioms needed to move between pure and impure code. You may be right though, it's something I should probably revisit. It's been a couple years and I did end up taking some of the lessons learned from Haskell into other languages (mostly not at a low level, though -- it's more that Haskell informed how to approach some higher-level design problems). Railway-oriented programming in particular stuck with me as a _great_ pattern that's consistently useful across languages. I still think it's worth learning by anyone who's got the time for it.