-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple library for validating chess moves and parsing PGN files -- @package chesshs @version 0.2.0 -- | The main move validation module. FEN parsing code is in Chess.FEN and -- PGN parsing is in Chess.PGN module Chess data MoveError -- | It's not your turn WrongTurn :: MoveError -- | There is no piece at the "from" position NoPiece :: MoveError -- | Your king is checked and this move doesn't solve that IsCheck :: MoveError -- | After this move your king would be checked CausesCheck :: MoveError -- | This is not how that piece works InvalidMove :: MoveError -- | You cannot move over other pieces OverPiece :: MoveError -- | This move captures one of your own pieces CapturesOwn :: MoveError -- | I don't understand what you mean NoParse :: MoveError data Color Black :: Color White :: Color data PieceType Rook :: PieceType Knight :: PieceType Bishop :: PieceType Queen :: PieceType King :: PieceType Pawn :: PieceType data Piece Piece :: Color -> PieceType -> Piece clr :: Piece -> Color piece :: Piece -> PieceType data Board Board :: Color -> String -> Maybe (Int, Int) -> Array (Int, Int) (Maybe Piece) -> Board turn :: Board -> Color castlingAvail :: Board -> String enpassant :: Board -> Maybe (Int, Int) board :: Board -> Array (Int, Int) (Maybe Piece) -- | Takes a position like "a5" and returns the coordinates (0,4) strToPos :: String -> (Int, Int) -- | Like pieceAtStr, but with coordinates instead of a string pieceAt :: Int -> Int -> Board -> Maybe Piece -- | What piece is currently at this position on the board? pieceAtStr :: String -> Board -> Maybe Piece -- | Perform a move on the board in coordinate notation like "e2e4", -- returning either the new board or an error move :: [Char] -> Board -> Either MoveError Board -- | Perform a move in SAN notation on the board and return either the new -- board or an error moveSAN :: [Char] -> Board -> Either MoveError Board -- | Is the player of the given colour check? check :: Color -> Board -> Bool -- | Is the player with the given colour checkmate mate :: Color -> Board -> Bool -- | Can the player of the given colour make any move? stalemate :: Color -> Board -> Bool instance Eq MoveError instance Show MoveError instance Eq MoveType instance Show MoveType instance Eq Color instance Show Color instance Eq PieceType instance Show PieceType instance Eq Piece instance Eq Board instance Show Board instance Show Piece instance Read Piece module Chess.FEN fromFEN :: String -> Maybe Board toFEN :: Board -> String defaultFEN :: String defaultBoard :: Board module Chess.PGN pgnParser :: Parser ByteString [PGN] data PGN PGN :: String -> String -> String -> String -> String -> String -> Maybe GameResult -> Maybe Board -> [Move] -> PGN event :: PGN -> String site :: PGN -> String date :: PGN -> String round :: PGN -> String whitePlayer :: PGN -> String blackPlayer :: PGN -> String result :: PGN -> Maybe GameResult initialPosition :: PGN -> Maybe Board moves :: PGN -> [Move] data GameResult WhiteWon :: GameResult BlackWon :: GameResult Draw :: GameResult instance Eq GameResult instance Show GameResult instance Show PGN