Ad
  • Custom User Avatar

    Failed to parse solution for "do not use implemented Prelude" test, got messsage:

    uncaught exception: IOException of type UserError
    user error (Could not parse solution correctly)
    

    But I really cannot findout which function in my code is the 'implemented Prelude', can we provide more specific limits?

    besides, here is the Prelude functions I used:

    (,), Just, Nothing, (:), ([]), Left, Right  
    
  • Custom User Avatar

    The tests should limit the imports from the solution to only those being tested, as any defined helpers may clash with names in the tests.

  • Custom User Avatar

    Kotlin translation waiting for approval

  • Default User Avatar

    I'm (still) experiencing floating point errors.

    can compute general complex signum
    expected: Complex 0.6 0.8
     but got: Complex 0.6000000000000001 0.8
    

    Edit: I "solved" the problem by explicitly defining division (/) instead of only defining recip. Now my solution passes all example test cases. However when I submit it, it still gives an error every time.

    can compute general complex signum
    Falsifiable (after 1 test and 309 shrinks): 
    NonZero {getNonZero = 1.4e-44}
    NonZero {getNonZero = 1.0e-45}
    
  • Custom User Avatar

    If you structure main as

    main = do
      hspec $ do
        describe "" $ do
          it "" $ do
            x `shouldBe` y
      hspec $ do
        describe "" $ do
          it "" $ do
            a `shouldBe` b
    

    you don't increase the test indent continuously.

    Quite unessential, but I think it looks better.