On Fri, 7 May 1999, S.D.Mechveliani wrote: > Also D.Tweed <[EMAIL PROTECTED]> writes > > > [..] it may dramatically affect the size of expressions held > > temporarily, eg > > > > tipsOfTheDay > > = map addCopyrightLogo (map toUppercase (map addHaveANiceDay > > [tip1,tip2,tip3,........,tip_n])) > > > > will, if I understand correctly, transform given the rules > > generally envisaged > > > > map f . map g ==> map (f.g) > > map f (x:xs) ==> f x:map f xs > > > > into > > > > tipsOfTheDay=[addCopyrightLogo(toUppercase(addHaveANiceDay tip1)),...... > > addCopyrightLogo(toUppercase(addHaveANiceDay tip_n))] > > > > even if n is 1000 but only three or four tips are ever actually used in > > the program, with the consequent increase in the number of closures > > stored. [..] > > > But the rules apply at compile time. Do i understand correct? > In this particular example the compilation cost is proportional to the > list length [tip1,tip2,tip3,........,tip_n]. > And the programmer does not set `tip_n', one sets the concrete data, > not very long, say, [tip1,tip2,tip3,tip4,tip5]. My notation could have been better: what the above was supposed to mean was a list of n literal things in the source code, where n is say 400. Perhaps because I've never taken the time to figure out how to do data-structure dumping in binary, I often find I write programs that take nicely formatted stuff and process it a bit and output large CAFs in the form of a Haskell module, e.g., I half wrote an interpreter where I took this approach with the name-token binding table, etc. Maybe it is very naive programming style, but it's the approach I've ended up using a lot. ___cheers,_dave______________________________________________________ email: [EMAIL PROTECTED] "Someday, even toasters will have www.cs.bris.ac.uk/~tweed/pi.htm monads in them thanks to Haskell." work tel: (0117) 954-5253 M P Jones (allegedly)