Created
September 17, 2017 20:04
Star
You must be signed in to star a gist
show instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance Show ValidationError where | |
show (SquareTaken x) = "Move #" ++ show (x + 1) ++ " is invalid - the square is already taken!" | |
show (WrongPiece x expected actual) = "Wrong piece on move #" ++ | |
show (x + 1) ++ | |
". Expected '" ++ show expected ++ "', got '" ++ show actual ++ "'." | |
show (WrongName x expected actual) = "Wrong player name on move #" ++ | |
show (x + 1) ++ ". Expected '" ++ expected ++ "', got '" ++ actual ++ "'." | |
show WrongFirstMove = "X must make the first move." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment