Ad
  • Custom User Avatar

    It was fun to discover nega-binaries. But in the meantime, I realized that ternary (base 3) numbers offer negatives more naturally by using the digit -1 instead of 2, so we have numbers ..., ˧11, ˧˧, ˧0, ˧1, ˧, 0, 1, 1˧, 10, 11, 1˧˧, ....

    Also, for binaries we can simply add another terminator besides the zero end, which corresponds to infinite 1 digits to the left, but it actually acts in all means as -1.

  • Custom User Avatar

    Thank you very much.
    Sorry, I lost focus and could have turned to this somewhat later only..

  • Custom User Avatar

    Indeed, thanks for clarifications. Added true, false, if as requirement.

  • Custom User Avatar

    I clarified it at each occurence. I'd prefer to keep the shorter name.

  • Custom User Avatar

    Well, yes, actually it's still in almost draft state. Very beta yet :)
    Thanks for all the feedback, will work on them tomorrow.

    About the left or right operator precedence, everything is read and executed from left to right, and actually function composition is associative and indeed the nature of (how we write) function application suggests the right-to-left flow.

  • Custom User Avatar

    My comments:

    1. For labelDepth a bit more detailed description would be nice.
    2. For me, the 'Chronological Order' at runWriterMonoid means just the opposite of the expected one, especially for lists.
    3. Between runWriterMonoid and runWriterList it would be good to add that
      Free (Writer w) a is also a functor in w.
  • Custom User Avatar
  • Custom User Avatar

    Originally I thought we can allow more arguments, however, it's indeed much clearer to exclude that case as well.
    Updated the kata and even separated the testcases accordingly.

  • Custom User Avatar

    I tried to solve it using sized generators, but for some reason its performance was even poorer. Finally I simply added random weights, and for me it seems to be stable enough.

    Please verify, confirm and/or resolve.

  • Custom User Avatar

    Sorry, I'm indeed total inactive in this page for a while, but rarely I react on mail notifications.
    I'm happy that my kata is being pushed forward.

  • Custom User Avatar

    There's a class B defined as below, with a method f. We define b=B(), assert to the return value of b.f() then modify b.y, then assert again.

    @remember
    class B(object):
        def __init__(self, x=1, y=2):
            self.x, self.y = x, y
        def f(self):
            return self.x, self.y
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    • Yes, there are checks for add and mult if getting called.
    • id really does nothing but saves its input value in order to expect_value can compare it.
  • Custom User Avatar
  • Custom User Avatar

    There's no further requirement for that case, you're free to always use the first seen value. The tests should accept any value seen for d[1]. From the kata description:

    In the first case, any corresponding value d[key] will be accepted

  • Loading more items...