Ad
  • Custom User Avatar

    I've made a fork that checks that the solution class isn't a subclass of fractions.Fraction.

  • Custom User Avatar

    I've made a fork that updates the description to more accurately describe the task for Python and Haskell.

  • Custom User Avatar

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

  • Custom User Avatar

    Merged

  • Custom User Avatar

    The addition of 2 Fraction instance should yield a Fraction instance, not its string representation. That one we will have to leave it to str / repr to do the job.

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Custom User Avatar

    The task is not defined. In Python and Haskell, one is asked to do very different things, actually one cannot rely on the description, but must guess hazardously from the initial code and sample tests.

    Concretely, for example in Haskell, the initial code includes a definition for signum, abs and negate functions (what should they be?). There's no need to define them to pass the tests, but we get warnings from GHC's tests:

    STDERR
    src/Fraction.hs:18:10: warning: [-Wmissing-methods]
        • No explicit implementation for
            ‘abs’, ‘signum’, and (either ‘negate’ or ‘-’)
        • In the instance declaration for ‘Num Fraction’
       |
    18 | instance Num Fraction where
       |          ^^^^^^^^^^^^
    

    What's the point?

  • Custom User Avatar

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

  • Custom User Avatar

    True. I had wasted a lot of time thinking what went wrong until I saw your comment. By convention, the minus sign is never placed in the denominator in a reduced fraction. I think this should be an issue rather than a suggestion.

  • Custom User Avatar
  • Custom User Avatar

    I used the magic method repr and get lots of errors like '37/40 should equal 37/40'. Can somebody give my hint as to what is going on here?

  • Custom User Avatar

    you must be kidding!!!!!! mine's big too:(

  • Custom User Avatar

    You should make them keep the negative number of a negative fraction in the numerator. I did that and got confused when it wouldn't work on my attempts. I did the solution in haskell, and in that version of the problem there was no mention on where the negative sign should be placed or if it should be placed in a specific location at all.

  • Custom User Avatar

    Done.

  • Custom User Avatar

    DON'T use the built-in class fractions.Fraction

    Not enforced.

  • Loading more items...