I do not know Stephen Diehl but I hope you're right about his capabilities, it would definitely be exciting to see that in Haskell!
http://stackoverflow.com/questions/6364409/why-does-haskells...
(a) be consistent as if the language had type-level literals, which resulted in nicer code in the usual case, but some unsafety on unchecked edge cases, or
(b) give more safety, but force everyone to check for the empty list even when they don't need to.
They went with (a) - it's the type of decision Haskell is (I'd argue incorrectly) criticized for not doing - people complain about having to prove things to their compiler. Of course, in hindsight, and given the language ecosystem now (and that option (b) is instead consistent with all the monad-centric libraries, etc.), (b) seems like a better choice. Which one is better could just as easily change again if empty lists became distinguished at the type-level in Prelude in the future. This is also something that would either crash, or be similarly inconsistent (just return null, causing eventual crashes instead) in any other language. It's notable, though, that the community is making effort to fix these tiny inconsistencies, rather than punting on it for backwards compatibility, as so many other ecosystems do.
map transform . catMaybes . map safeHead
map transform . mapMaybe safeHeadThat does not make it a good choice. Just a kind of default, but it's a bad default.
Before using stack I was always afraid to come back to a Haskell project after a few months, since using stack that's not a problem. Also, you don't have to worry about different machines, because stack is ensuring that you have the pretty much same build environment (at least the Haskell packages will have the exact same version).
Stack also recently added support for using Nix to solve the problem fixing non-Haskell dependencies for a project.
Why have I never heard about it in all the guides and StackOverflow answers I've had to search through when trying to escape Cabal hell?