[Haskell-cafe] Re: Hints for Euler Problem 11

Aaron Denney wnoise at ofb.net
Wed Aug 15 14:22:35 EDT 2007


On 2007-08-15, Pekka Karjalainen <p3k at iki.fi> wrote:
> On 8/15/07, Mathias Biilmann Christensen <mathiasch at gmail.com> wrote:
>> Spotted this thread as I was working on a Haskell solution for this
>> one myself - here's the solution I came up with:
>> [ ... ]
>> raw_matrix =
>>  "08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 " ++
>>  "49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 " ++
>>  "81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 " ++
> [ ... ]
>
> A little style issue here on the side, if I may. You don't need to use
> (++) to join multiline string literals.
>
> text = "If you want to have multiline string literals \
>        \in your source code, you can break them up with \
>        \backslashes. Any whitespace characters between \
>        \two backslashes will be ignored."

I find the first far more readable.  The compiler should be able to
assemble it all at compile time, right?

-- 
Aaron Denney
-><-



More information about the Haskell-Cafe mailing list