Skip to content

Avoiding head and tail in GHC codebase

I'm investigating feasibility of adding a {-# WARNING #-} to Data.List.{head,tail}, which is a subject of https://github.com/haskell/core-libraries-committee/issues/87. Before moving forward with the proposal, I'd like to learn what kind of burden it puts over developers.

GHC codebase is extensive, old and uses head a lot, which makes it a perfect candidate for investigation. If I (presumably, singlehandedly) succeed in eliminating all use cases of head and tail, it will be a strong argument in favor of the proposal. If I don't succeed - well, at least, we end up with less partiality in GHC, which is good anyway. I'm gonna submit small, limited in surface PRs, gradually moving to the goal.

Upd.: CLC has approved the proposal.

Edited by Bodigrim
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information