Ad
  • Custom User Avatar

    modified (with something else)

  • Custom User Avatar

    From the description: "This means that being r = result, r^n = x;"

    is not really clear. Waybe reword to (root x n)^n = x?

  • Custom User Avatar

    Sorry, forgot to mention that if two hands are equal, first hand should be returned

  • Custom User Avatar

    betterHand function returns a Hand, so it is not clear what to do if hands are equal.

  • Custom User Avatar

    Well, in this kata you don't need to use maps or sets of hands. I used Ord instance to emphasize that one need to compare hands

    However, I changed kata so now it doesn't requires writing an Ord Hand

  • Custom User Avatar

    Some suggestions: While the custom Show and Read instances are probably nice for some testing on a local machine, they just clutter the code. They're not necessary. Furthermore, you shouldn't base your test cases on the user's Read instance. If you had used your own solution instead of the correct answers, my (evil) Read instance for Hand would have made it tremendously easy to cheat. You either have to make sure that the Read instance is still valid, or create Hand values without read.

    That's not the only way to cheat. Since your tets cases don't include a random test, one can use a counter. You could prevent this by using hidden [ Module "System.IO.Unsafe", Module "Data.IORef"]. Or you simply write an additional property test. Keep in mind that the (randomly) generated hands should be valid.

  • Custom User Avatar

    All fixed. Marked as resolved.

  • Custom User Avatar

    The description of the kata is all messed up.

  • Custom User Avatar

    Isn't there are some issues with writing an instance of Ord like this? Some hands will be tied according to Poker rules, and I guess EQ will be returned in those cases. However, this means that the Ord instance will not be a total order (indeed, not even a partial order). This means that you can't store hands realiably in a container relying on Ord, e.g. Data.Map or Data.Set.

  • Custom User Avatar

    I think when comparing two LengthLists, it should handle the case that one of them is infinite. (The infinite one is greater than the other one)

  • Custom User Avatar

    You're right. And thanks for fixing the i and l.

  • Custom User Avatar

    Thank you, found another location for i -> l. The missing where is valid syntax when the instance definition itself is empty. These instances must be filled in before the test cases will compile.

  • Custom User Avatar
    • where missing at both instance declarations
    • function i should be l instead (according to a post below that should have been fixed, but it still appears this way)
  • Custom User Avatar

    It feels a bit clunky to have a fold function that takes seven functions. But you are of course correct.

  • Custom User Avatar

    Good call, I missed that on the edit. Fixed now!

  • Loading more items...