[Haskell-beginners] Help with improving a program

Florian Gillard florian.gillard at gmail.com
Thu Jul 10 13:24:44 UTC 2014


I don't know if this is any good but here is my attempt to solve this.

I used comprehensions.

It seems to be working fine with the test files :)



On Thu, Jul 10, 2014 at 11:35 AM, Frerich Raabe <raabe at froglogic.com> wrote:

> On 2014-07-10 11:24, Francesco Ariis wrote:
>
>> On Wed, Jul 09, 2014 at 11:02:14PM -0300, Marcelo Lacerda wrote:
>>
>>> Hi I'm just starting with haskell and want some help with it.
>>>
>>> I tried to solve the Store Credit[1] problem from google code jam just
>>> to practice, the result was a slow code[2] that I find hard to read.
>>>
>>> Can you guys give me some directions on how to improve it?
>>>
>>> [1] - https://code.google.com/codejam/contest/351101/dashboard#s=p0
>>> [2] - http://pastebin.com/jNGxGP5H
>>>
>>>
>> Don't know about efficiency, but I never liked (!!). Maybe computing all
>> pairs+positions in advance using |zip| would be a little better?
>>
>
> Yeah, that's what I went for as well. I'm attaching my solution for
> comparison to this mail.
>
>
> --
> Frerich Raabe - raabe at froglogic.com
> www.froglogic.com - Multi-Platform GUI Testing
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140710/3db2e882/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: credit.hs
Type: text/x-haskell
Size: 1005 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140710/3db2e882/attachment.hs>


More information about the Beginners mailing list