statTest :: Stats -> Stats -> (String, Stats -> Double) -> Test
statTest expected actual (label, f) =
  TestLabel label $
  TestCase $ assertBool errMsg $
  isClose expectedVal actualVal
  where
    errMsg = "expected: " ++ show expectedVal ++ " got: " ++ show actualVal
    expectedVal = f expected
    actualVal = f actual
statTest :: Stats -> Stats -> (String, Stats -> Double) -> Test
statTest expected actual (label, f) =
  TestLabel label $
  TestCase $ assertBool errMsg $
  isClose expectedVal actualVal
  where
    errMsg = "expected: " ++ show expectedVal ++ " got: " ++ show actualVal
    expectedVal = f expected
    actualVal = f actual
statTest expected actual (label, f) =
  TestLabel label $
  TestCase $ assertBool errMsg $
  isClose expectedVal actualVal
  where
    errMsg = "expected: " ++ show expectedVal ++ " got: " ++ show actualVal
    expectedVal = f expected
    actualVal = f actual