[Haskell-cafe] Hints for Euler Problem 11
lennart at augustsson.net
Fri Aug 17 04:33:26 EDT 2007
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 at asuhan.com> wrote:
> Lennart Augustsson wrote:
> > On 8/16/07, Kim-Ee Yeoh <a.biurvOir4 at 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
> > 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:
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe