Haskell

Timon Gehr timon.gehr at gmx.ch
Wed Aug 24 17:17:45 PDT 2011


On 08/25/2011 01:15 AM, Timon Gehr wrote:
> On 08/24/2011 11:55 PM, bearophile wrote:
>> Timon Gehr:
>>
>>> If anyone is interested:
>>> http://pastebin.com/2rEdx0RD
>>
>> I suggest you to usually compile your D code with -w, I see some
>> missing overrides. At line 40 it gives me a "Warning: statement is not
>> reachable".
>
> There is only one missing override, but it is reported for every
> instantiation of the template. Statement at line 40 is necessary to make
> the /type inference/ work out, and such things are the reason I don't
> usually turn warnings on. Another example where warnings are a pita:
>
> case "bla","blu","blo": // Warning: fallthrough
> case "xxx","yyy","zzz":
>
> What the code expresses is: There are two cases, one occurs if the input
> is bla blu or blo, and the other one if it is xxx or yyy or zzz. Those
> cases should be handled the same way. (At least for now).
> goto case; is both unnecessary and ugly in that case.
>
> So basically, for me there are too many false positives to make the -w
> switch really practical, which is a pity, as they would have catched the
> missing override in this case.
>
>
>>
>> Are you able to use it to translate the Haskell version of this task?
>> http://rosettacode.org/wiki/Hamming_numbers#Haskell
>>
>
> Challenge accepted.
>

ASDF. I got it working quite fast, and then I started a fight with 
std.bigint.BigInt.toString until I accidentally cp'd over my source 
code. That will be reported soon, it makes BigInt UNUSABLE.

I am going to code it again...


More information about the Digitalmars-d mailing list