runhaskell MathSpec.hs
absolute
returns the original number when given a positive input FAILED [1]
returns a positive number when given a negative input FAILED [2]
returns zero when given zero FAILED [3]
Failures:
MathSpec.hs:10:
1) absolute returns the original number when given a positive input
uncaught exception: ErrorCall (Prelude.undefined
CallStack (from HasCallStack):
error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
undefined, called at Math.hs:5:12 in main:Math)
MathSpec.hs:13:
2) absolute returns a positive number when given a negative input
uncaught exception: ErrorCall (Prelude.undefined
CallStack (from HasCallStack):
error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
undefined, called at Math.hs:5:12 in main:Math)
MathSpec.hs:16:
3) absolute returns zero when given zero
uncaught exception: ErrorCall (Prelude.undefined
CallStack (from HasCallStack):
error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
undefined, called at Math.hs:5:12 in main:Math)
Randomized with seed 921447365
Finished in 0.0005 seconds
3 examples, 3 failures

Step 4: Implement your desired behavior

Step 5: Run again and see it pass

runhaskell MathSpec.hs
absolute
returns the original number when given a positive input
returns a positive number when given a negative input
returns zero when given zero
Finished in 0.0005 seconds
3 examples, 0 failures