Re: strictness of unused arguments

2010-03-12 Thread Roman Beslik
Thanks again. On 12.03.10 15:38, Max Bolingbroke wrote: There is nothing *published* (Simon has a half-written one lying around though), but the general approach is similar to that shown in "Projections for strictness analysis" at http://homepages.inf.ed.ac.uk/wadler/topics/strictness-analysis.h

Re: strictness of unused arguments

2010-03-12 Thread Max Bolingbroke
On 12 March 2010 13:13, Roman Beslik wrote: > Thanks for the answer. Sorry, I can not follow all of your thoughts because > my knowledge of strictness analysis and GHC optimizations are very basic. :( > I looked into GHC code once several years ago. BTW there are a lot of papers > about strictness

Re: strictness of unused arguments

2010-03-12 Thread Roman Beslik
Thanks for the answer. Sorry, I can not follow all of your thoughts because my knowledge of strictness analysis and GHC optimizations are very basic. :( I looked into GHC code once several years ago. BTW there are a lot of papers about strictness analysis, but I do not know which is relevant fo

Re: strictness of unused arguments

2010-03-11 Thread Max Bolingbroke
On 11 March 2010 12:50, Roman Beslik wrote: > I also can force the analyzer to think that "x1" and "x0" are strict by > eta-expanding "f3": There seem to be two issues here. 1) GHC only figures out and records strictness information on lambdas that are syntactically together. I'm not sure how ha

strictness of unused arguments

2010-03-11 Thread Roman Beslik
Hi all. I provide a sample program which causes a strange behavior of strictness analyzer. variant 1 {{{ module StrictUnusedArg (main) where f2 :: Int -> Int -> Int f2 x1 = if x1 == 0 then (\x0 -> x0) else let y = x1 - 1 in f3 y y f3 :: Int -> Int -> Int -> Int f3 x2 = if x2 == 0 then f