diff options
author | Erin van der Veen | 2017-11-20 13:44:55 +0100 |
---|---|---|
committer | Erin van der Veen | 2017-11-20 13:44:55 +0100 |
commit | d21008807191c7e60984a5f5299321e4ca72502e (patch) | |
tree | ca15392ebfa83a5c10051511bf0077ded9567cc6 /test/Test.hs | |
parent | Merge remote-tracking branch 'origin/master' into 1-quickcheck-property-niet-... (diff) |
Fix issues in number of pieces property
Diffstat (limited to 'test/Test.hs')
-rw-r--r-- | test/Test.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/Test.hs b/test/Test.hs index 7155d84..6741e70 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TemplateHaskell, ParallelListComp #-} -- vim: sw=2 ts=2 et ai: module Test where @@ -29,7 +29,9 @@ atAnyState ok pgn = and [ok b | Right b <- seqList [moveSAN m | m <- moves pgn] seqList [] _ = [] atAnyTwoStates :: (Board -> Board -> Bool) -> PGN -> Bool -atAnyTwoStates ok pgn = and [ok b1 b2 | Right b1 <- seqList [moveSAN m | m <- moves pgn] | Right b2 <- seqList [moveSAN m | m <- moves pgn] $ Right defaultBoard] +atAnyTwoStates ok pgn = + let moveList = seqList [moveSAN m | m <- moves pgn] $ Right defaultBoard in + and [ok b1 b2 | Right b1 <- moveList | Right b2 <- tail moveList] where seqList :: [r -> Either e r] -> Either e r -> [Either e r] seqList (f:fs) (Right io) = f io:seqList fs (f io) |