tasuki 2 days ago

Not the person you're replying to, but I'll bite:

I've written low thousands of lines of Haskell. Similar to mikojan, I love Haskell in theory, but ended up not enjoying it as much in practice.

1. The multitude of string-y types. I end up converting between String, Text, Lazy Text, ByteString, Lazy ByteString, and I forget what else. Each library wants me to pass in a specific string type, and each other library returns a different string type. LLMs are good at this, also for a while I had a ton of helper functions to convert between any two string types. Still, perhaps there's a better way?

2. The error messages. I come from Elm, so I'm spoiled. Yes, I understand a language with HKTs will never have as nice error messages. Yes, LLMs are pretty good at explaining GHC error messages.

3. The stdlib. Haskell gets a lot of credit for safety, but a `head` blows up instead of returning a `Maybe`. I know there are other - safer - preludes, but I don't know how to choose between them. I don't know how using a different prelude would impact my projects.

I feel like my next step is either towards Idris, with its polished standard library (and dependent types baked into the language!), or towards something simpler and more Elm-like (Gleam perhaps, or Roc). But if you can sell me on Haskell, I'm all ears!

3
kreyenborgi 1 day ago

The manual string conversions are annoying. But with https://hackage.haskell.org/package/string-conversions-0.4.0... you just add a `cs` and don't think more about it.

tasuki 21 hours ago

Oooh this is very nice!

cosmic_quanta 2 days ago

I'm not going to sell you on anything. All of the things you've mentioned are true. Loosely, the multitude of string types and the state of the standard library come from the same place: the language is 30+ years old! There are many warts to be found.

However, if you decide to start learning, the path is hard, especially if you come from a non-computer-science background like me. I attempted to learn Haskell twice; I bounced off the first time, quite hard, and didn't try again for years.

What worked for me is a combination of two things:

* Having a goal in mind, that has nothing with the choice of language. For me, it was building a personal website

* The book Haskell Programming from First Principles [0]

and if you have more questions, reach out.

[0]: https://haskellbook.com/

tasuki 2 days ago

> Having a goal in mind, that has nothing with the choice of language

Yes, yes, that's exactly what my encounters with Haskell looked like. The last one is ~1k lines of code backend for a personal project. I feel that's about as much as I could manage at this point.

> The book Haskell Programming from First Principles

That book is getting recommended all the time! I'm concerned if it's perhaps a little too basic for me. (I understand monads, monad transformers, have some notion of final tagless and free monad. Yet I get perpetually confused by various relatively simple things.)

I guess what I'm missing is haskell-language-server to help me a little. Here I'm confused about the interplay between `haskell-stack` (which is in Debian repos and which I think I'd like to use), ghcup, cabal, and haskell-language-server.

butterisgood 2 days ago

Hence GHC extensions? Overloaded Strings don’t help? It’s been about 20 years since I wrote Haskell in production.