[Haskell] Excessive sharing and GHC

Simon Peyton-Jones simonpj at microsoft.com
Wed Oct 19 03:43:26 EDT 2005


| > >I was thinking it would be nice if one could put a pragma on CAFs
that
| > >basically made ghc treat them as WHNF so it would float them inward
as
| > >far as possible including inside lambdas. in particular, constant
| > >strings that are created (cheaply) from efficient internal
| > >representations should not be held onto in their inefficient form.

I think the way to do this is to explain to GHC that 
	unpackCString :: String# -> [Char]
is a "cheap" function; that is, applications of it can safely be
duplicated.  There's no pragma to do this to an arbitrary at present,
but it'd be a sensible sort of pragma to have.

I wonder if it would make any difference in practice.

Simon 


More information about the Haskell mailing list