Ad
  • Custom User Avatar

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

  • 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?

  • Default 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

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

    Not enforced.

  • Custom User Avatar

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