Skip to content

Commit d50dfab

Browse files
committed
[fix] corrected replicateProp1
1 parent 33bc53a commit d50dfab

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

HaskellExercises05/stack.yaml.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
packages: []
77
snapshots:
88
- completed:
9-
size: 533252
10-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/27.yaml
11-
sha256: c2aaae52beeacf6a5727c1010f50e89d03869abfab6d2c2658ade9da8ed50c73
12-
original: lts-16.27
9+
size: 534126
10+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/31.yaml
11+
sha256: 637fb77049b25560622a224845b7acfe81a09fdb6a96a3c75997a10b651667f6
12+
original: lts-16.31

HaskellExercises05/test/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ replicateProp1 :: Int -> Int -> Bool
8080
replicateProp1 n x =
8181
let
8282
repls = E5.replicate n x
83-
in length repls == n
83+
in (length repls == n) || (n < 0 && length repls == 0)
8484

8585
-- | QuickCheck proposition for testing Exercises05.!!
8686
indexProp :: [Int] -> Int -> Bool

0 commit comments

Comments
 (0)