4 ms·
> 1. Decide on an effect system This shouldn't even be proposed as a question to someone new to Haskell. They should learn how monad transformers work and just
by solomonb 2y ago
> 1. Decide on an effect system
This shouldn't even be proposed as a question to someone new to Haskell. They should learn how monad transformers work and just use them. 90% of developers playing around effect systems would be just fine with MTL or even just concrete transformers. All Haskell effect systems should be considered experimental at this point with unclear shelf lives.
Everything else you said I agree with as solid advice!
- cosmic_quanta 2y agoSomeone truly new to Haskell shouldn't use it professionally. Once you've learned what is necessary to, say, modify already-existing applications, you should be familiar with monads and some basic monad transformers like ReaderT. Once you're there, I don't think 'choosing an effect system' is a perilous question. The monad transformer library, mtl, is an effect system, the second simplest one after IO.
- solomonb 2y agoThe original poster said they want to use Haskell professionally but that they are struggling to understand how to structure programs. > Once you're there, I don't think 'choosing an effect system' is a perilous question. The monad transformer library, mtl, is an effect system, the second simplest one after IO. I'm aware of that, generally when people say "choose effect system" they mean choose some algebraic effect system, all of which (in Haskell) have huge pitfalls. The default should be monad transformers unless you have some exceptional situation.
- cosmic_quanta 2y agoI realize I didn't mention monad transformers at all in my original post, I only linked to them! I should have mentioned that, as you say, monad transformers should be the default effect system choice for 99% of people
- tome 2y ago> generally when people say "choose effect system" they mean choose some algebraic effect system This isn't really true. Bluefin and effectful are effect systems, but not algebraic effect systems.
- HelloNurse 2y agoOn a software engineering level choosing such unusually deep-reaching libraries unusually soon in the development of a program is a major but uninformed commitment, a dangerous bet that more practical programming languages try to avoid imposing on the user.
- tome 2y ago> This shouldn't even be proposed as a question to someone new to Haskell. They should learn how monad transformers work and just use them. 90% of developers playing around effect systems would be just fine with MTL or even just concrete transformers. All Haskell effect systems should be considered experimental at this point with unclear shelf lives. This is highly debatable. I would say that the effect systems effectful and Bluefin are actually significantly simpler than MTL and transformers, particularly as soon as you need to do prompt resource cleanup. Personally I'd say that if newbies should start with naked IO and then switch to effectful or Bluefin once they've realised the downside of IO being available everywhere. > All Haskell effect systems should be considered experimental at this point with unclear shelf lives. effectful and Bluefin are here to stay. I guarantee it. For non-IO-based effect systems (e.g. polysemy, freer-effects) I agree. (Disclaimer: I'm the author of Bluefin)
- solomonb 2y ago> effectful and Bluefin are here to stay. I guarantee it. For non-IO-based effect systems (e.g. polysemy, freer-effects) I agree. Just to be clear I think Bluefin is really cool and I'm a fan of your work overall. I'm speaking from the industry/production perspective here. When polysemy and freer-effects were released there was a similar belief that they were here to stay. transformers and MTL have stood the test of time, are heavily documented, and are pervasive throughout Hackage. Understanding them and how to build programs with them is essential for anyone trying to break into 'production haskell' as a career move.
- tome 2y ago> Just to be clear I think Bluefin is really cool and I'm a fan of your work overall. Thanks! > I'm speaking from the industry/production perspective here. When polysemy and freer-effects were released there was a similar belief that they were here to stay. Well, from my perspective, I've never worked at a place that's used polysemy of freer-effects. > transformers and MTL have stood the test of time, are heavily documented, and are pervasive throughout Hackage. Understanding them and how to build programs with them is essential for anyone trying to break into 'production haskell' as a career move. Sadly true.