
30 Dec
2008
30 Dec
'08
3:51 p.m.
Am 30.12.2008 um 04:25 schrieb JustinGoguen:
I am having difficulty making [Char] an instance of Enum. fromEnum is easy enough: map fromEnum to each char in the string and take the sum. However, toEnum has no way of knowing what the original string was.
The problem you're having is that your implementation does not correctly enumerate lists of characters – in order to do so correctly, you must not create the clashes you get with (for example "ab" and "ba"). I'd suggest rethinking how you would enumerate such strings. Bob