Ad
  • Custom User Avatar
    test lastDigit [x, y, z]
    ✘ Falsifiable (after 69 tests and 5 shrinks): 
    expected: 3
     but got: 7
    NonNegative {getNonNegative = 27}
    NonNegative {getNonNegative = 15}
    NonNegative {getNonNegative = 15}
    

    Looking at this actually seems to reveal the issue, as logging the input arguments (with trace + show) shows that my code is called with [27, 15, 14] (which ends in 7) instead of [27, 15, 15] (which ends in 3).

  • Custom User Avatar

    The following Haskell test case fails for me: lastDigit [7,11,2], expected 3 but got 7. However, checking 7^(11^2) in Wolfram Alpha shows that the last digit is, indeed, 7.