Skip to content

Investigate delayed substitutions in types

GHC's type representation can sometimes blow up. See

The problem is that when you have a nested tuple application, e.g. ((4,True),('c','d')), the size of the type arguments grows quadratically with the expression size. This bites badly in some approaches to generic programming, which use nested tuples heavily.

It's explained in detail in Section 2.3 of Scrap your type applications.

One solution might be to switch to the type system of "Scrap your type applications". But that would be a Big Deal.

A more modest approach is to use delayed substitutions. Here is a wiki page describing the delayed-substitution idea. This ticket is to track progress on investigating that idea.

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