It's very hard to tell if it's worth it or not.  Concatenating constant strings will turn the string into WHNF, which might enable some other transformation.  By having lots of little transformations that on their own look worthless you can make big improvements.
I'd like to see as much static evaluation as is practically possible.

And as a previous poster showed, ghc does concatenate strings.

On 8/17/07, Kim-Ee Yeoh <a.biurvOir4@asuhan.com> wrote:


Lennart Augustsson wrote:
>
> On 8/16/07, Kim-Ee Yeoh <a.biurvOir4@asuhan.com> wrote:
>> 'Course not. The (++) function like all Haskell functions is only a
>> /promise/ to do its job. What does "assembling at compile time"
>> mean here:
>>
>> s = "I will not write infinite loops " ++ s
>
> But if the strings are all constant it's perfectly feasible to concatenate
> them at compile time.
>

It's feasible and I might add that it isn't worth it. Not for just
concatenation. How much static evaluation do you want to see
in Haskell?

--
View this message in context: http://www.nabble.com/Hints-for-Euler-Problem-11-tf4114963.html#a12195537
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe