I came across this paper proposing that Let Should Not Be Generalized (TLDI 2010, Vytiniotis, Peyton Jones, and Schrijvers).
While generalisation for local let bindings is straightforward in Hindley-Milner, we show that it becomes much more complicated in more sophisticated type systems. The extensions we have in mind include functional dependencies, GADTs, units of measure, and type functions. The only technically straightforward way to combine these developments with let-generalisation has unpalatable practical consequences, that appear to be unavoidable.
I'm actually fairly convinced by this. Among other things, it provides a fairly clear path to eliminating the monomorphism restriction:
Our [] proposal completely subsumes the [Haskell monomorphism restriction] for local let bindings, so the MR would then only apply to top-level bindings. In that case the arguments for its abolition, or for generating a warning rather than rejecting the program, would become very strong. A nasty wart would thereby be removed from the face of Haskell.
Are they right? Are they wrong? Has anyone laid out the case for the defense?
Recent comments
2 days 2 hours ago
2 days 2 hours ago
2 days 2 hours ago
3 weeks 2 days ago
4 weeks 1 day ago
4 weeks 1 day ago
4 weeks 2 days ago
4 weeks 2 days ago
4 weeks 2 days ago
4 weeks 5 days ago