diff options
Diffstat (limited to 'src/runchess.hs')
-rw-r--r-- | src/runchess.hs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/runchess.hs b/src/runchess.hs index 5854e57..d1a86d2 100644 --- a/src/runchess.hs +++ b/src/runchess.hs @@ -21,17 +21,14 @@ readPGN = do Right games -> return games applyPGN :: PGN -> IO () -applyPGN pgn = mapM_ printBoard (seqList [moveSAN m | m <- moves pgn] $ Right defaultBoard) +applyPGN pgn = printPGN pgn >> mapM_ printBoard (seqList [moveSAN m | m <- moves pgn] $ Right defaultBoard) where seqList (f:fs) (Right io) = f io:seqList fs (f io) seqList _ (Left _) = [] seqList [] _ = [] -printGame :: Either MoveError Board -> PGN -> IO () -printGame b pgn = printPGN pgn >> printBoard b - printBoard (Left e) = putStrLn $ show e -printBoard (Right b) = putStr $ show b +printBoard (Right b) = putStrLn $ show b printPGN :: PGN -> IO () printPGN pgn = do |