From e8c8b1659b08492d913cf7b0bb362fe24db0b413 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 20 Nov 2017 13:55:11 +0100 Subject: Refactor atAnyState --- test/Test.hs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'test/Test.hs') diff --git a/test/Test.hs b/test/Test.hs index 6741e70..168983b 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -21,12 +21,7 @@ import Chess.PGN import ArbitraryMove atAnyState :: (Board -> Bool) -> PGN -> Bool -atAnyState ok pgn = and [ok b | Right b <- seqList [moveSAN m | m <- moves pgn] $ Right defaultBoard] - where - seqList :: [r -> Either e r] -> Either e r -> [Either e r] - seqList (f:fs) (Right io) = f io:seqList fs (f io) - seqList _ (Left _) = [] - seqList [] _ = [] +atAnyState = atAnyTwoStates . const atAnyTwoStates :: (Board -> Board -> Bool) -> PGN -> Bool atAnyTwoStates ok pgn = -- cgit v1.2.3