Set 10a Ex 4: new exercise

This commit is contained in:
Joel Kaasinen
2021-04-26 15:34:20 +03:00
parent 5bd7d338af
commit 10609cad55
3 changed files with 65 additions and 21 deletions
+2
View File
@@ -40,6 +40,8 @@ expected =~? actual = actual ?~= expected
infix 4 =~?
infix 4 ?~=
approximateListEq expected actual = expectation expected actual (length expected == length actual && and (zipWith (\e a -> abs (e-a) < 0.01) expected actual))
hasElements expected actual = counterexample' (" Expected elements (in any order): " ++ show expected
++ "\n Was: " ++ show actual)
(sort expected == sort actual)