I generally can write Haskell. I’m not especially good at it, I’m definitely not able to tell you how to use a ZygoHistoPremorphism in your code, but fundamentally I find Haskell code relatively comprehensible and there aren’t any blockers to my getting better at it other than time and effort. There’s a lot I like about the language, and I often steal ideas from it for use elsewhere.
And yet I have almost zero inclination to write real code in Haskell, and every time I get a slight hankering to do so this is quickly fixed.
Because the first thing I have to interact with every time I write some Haskell is cabal, and this is enough to cure me of any desire to continue the interaction all on its own.
There are a number of little irritations I have with Cabal. I could get over them. There’s no such thing as a good package manager, only less bad package managers.
But there’s one big thing that I simply cannot get over and prevents me from ever taking Haskell seriously as a platform until it has been fixed.
$ cabal uninstall somepackage cabal: unrecognised command: uninstall (try --help)
This is not just that it’s called one of the many other things people bewilderingly decide is the appropriate name for the uninstall command. cabal genuinely cannot uninstall packages. Further, having the wrong packages installed can leave you in a stuck state where you are unable to develop.
At which point the only fix is “trash your cabal install, rebuild cabal and cabal-install from source” (a process which takes nearly half an hour on my machine, and that’s before I’ve also rebuilt all my dependencies from source).
I understand that this is a hard problem which results from the underlying ghc-pkg infrastructure. I don’t really care.
I also understand that cabal sandboxes are a thing. I don’t care about that either. It helps for development, but you only have to make one mistake or give in to any of the myriad things that are pushing you to do a global install just this one time (binaries, incredibly slow build times, etc) to accidentally destroy your system.
The simple fact is that if the default mode of operation for the primary way of installing packages for your language is “oops, you did the wrong thing. Let me put your system in an inoperable state while you wait for everything to recompile from scratch” then what you have here is not a package manager, it’s a waste of time, and I have enough broken software wasting my time already.
I stand by everything I said in it’s OK for your open source to be shitty. There is no obligation on the part of the maintainers of Cabal, or of GHC, to fix these problems for free. But the fact that it’s OK for software to be shitty doesn’t make it not shitty, and the fact that more than 50% of the time I interact with Cabal I end up in a screaming rage means that I’m just going to not use it unless absolutely forced to, which in turn means that there’s basically zero chance of my ever treating Haskell as a serious development environment.
Edit to add: Brian Mckenna suggested this fix, which is to globally disable the ability to install outside a sandbox. This actually does make sandboxes a viable solution to the problem and is the only thing anyone has suggested that I consider an acceptable workaround. So although I stand by the claim that the cabal infrastructure is terrible, it may now at least be manageably terrible because it can be used without accidentally trashing your system.