Wadler space leak

Jan Christiansen jac at informatik.uni-kiel.de
Sun Nov 7 12:47:09 EST 2010

On 02.11.2010, at 10:20, Simon Marlow wrote:

> It's not really a question of priority, rather that we don't know of  
> a good way to fix it!

I would not have guessed that there exists a Haskell related problem  
that cannot immediately be fixed by the ghc headquarters ; )

If I understand correctly, the problem is to keep the selectors  
recognizable while still performing optimizations that might "destroy"  
the selector structure. In Bertram's example the resulting expression  
looked as follows.

>   l : case q of (_, ys) ->  case ys of
>                                               []   ->  []
>                                               _:zs ->  splitBy' p zs

Is it correct that the selector is not recognizable in this case  
because the right hand side fo the outermost case expression is not a  
simple variable but a case expression? It is probably quite naive to  
assume that the problem can be solved by looking for a structure like

   case q of
           (_,ys) -> e

where ys is a free variable in e. There are probably cases where  
further optimizations prevent this. Or do I miss the real problem in  
identifying selectors?

Cheers, Jan

More information about the Glasgow-haskell-users mailing list