{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE Safe #-}
module Data.Char.Chess
(
ChessColor (White, Black, Neutral),
ChessColorBinary (BWhite, BBlack),
ChessPieceType (King, Queen, Rook, Bishop, Knight, Pawn, Equihopper),
ChessHybridType (KnightQueen, KnightRook, KnightBishop),
ChessPiece (Chess90, Chess45Knight, ChessHybrid),
Rotate45 (R45, R135, R225, R315),
chessPiece,
pattern Grasshopper,
pattern Nightrider,
pattern Amazon,
pattern Terror,
pattern OmnipotentQueen,
pattern Superqueen,
pattern Chancellor,
pattern Marshall,
pattern Empress,
pattern Cardinal,
pattern Princess,
)
where
import Control.DeepSeq (NFData)
import Data.Bits ((.|.))
import Data.Char (chr)
import Data.Char.Core (Rotate90 (R0, R180))
import Data.Data (Data)
import Data.Hashable (Hashable)
import GHC.Generics (Generic)
import Test.QuickCheck.Arbitrary (Arbitrary (arbitrary), arbitraryBoundedEnum)
import Test.QuickCheck.Gen (oneof)
data ChessColorBinary
=
BWhite
|
BBlack
deriving (ChessColorBinary
forall a. a -> a -> Bounded a
maxBound :: ChessColorBinary
$cmaxBound :: ChessColorBinary
minBound :: ChessColorBinary
$cminBound :: ChessColorBinary
Bounded, Typeable ChessColorBinary
ChessColorBinary -> DataType
ChessColorBinary -> Constr
(forall b. Data b => b -> b)
-> ChessColorBinary -> ChessColorBinary
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ChessColorBinary -> u
forall u. (forall d. Data d => d -> u) -> ChessColorBinary -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColorBinary -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColorBinary -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessColorBinary -> m ChessColorBinary
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessColorBinary -> m ChessColorBinary
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessColorBinary
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessColorBinary -> c ChessColorBinary
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessColorBinary)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessColorBinary)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessColorBinary -> m ChessColorBinary
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessColorBinary -> m ChessColorBinary
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessColorBinary -> m ChessColorBinary
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessColorBinary -> m ChessColorBinary
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessColorBinary -> m ChessColorBinary
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessColorBinary -> m ChessColorBinary
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ChessColorBinary -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ChessColorBinary -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ChessColorBinary -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ChessColorBinary -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColorBinary -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColorBinary -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColorBinary -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColorBinary -> r
gmapT :: (forall b. Data b => b -> b)
-> ChessColorBinary -> ChessColorBinary
$cgmapT :: (forall b. Data b => b -> b)
-> ChessColorBinary -> ChessColorBinary
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessColorBinary)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessColorBinary)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessColorBinary)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessColorBinary)
dataTypeOf :: ChessColorBinary -> DataType
$cdataTypeOf :: ChessColorBinary -> DataType
toConstr :: ChessColorBinary -> Constr
$ctoConstr :: ChessColorBinary -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessColorBinary
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessColorBinary
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessColorBinary -> c ChessColorBinary
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessColorBinary -> c ChessColorBinary
Data, Int -> ChessColorBinary
ChessColorBinary -> Int
ChessColorBinary -> [ChessColorBinary]
ChessColorBinary -> ChessColorBinary
ChessColorBinary -> ChessColorBinary -> [ChessColorBinary]
ChessColorBinary
-> ChessColorBinary -> ChessColorBinary -> [ChessColorBinary]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ChessColorBinary
-> ChessColorBinary -> ChessColorBinary -> [ChessColorBinary]
$cenumFromThenTo :: ChessColorBinary
-> ChessColorBinary -> ChessColorBinary -> [ChessColorBinary]
enumFromTo :: ChessColorBinary -> ChessColorBinary -> [ChessColorBinary]
$cenumFromTo :: ChessColorBinary -> ChessColorBinary -> [ChessColorBinary]
enumFromThen :: ChessColorBinary -> ChessColorBinary -> [ChessColorBinary]
$cenumFromThen :: ChessColorBinary -> ChessColorBinary -> [ChessColorBinary]
enumFrom :: ChessColorBinary -> [ChessColorBinary]
$cenumFrom :: ChessColorBinary -> [ChessColorBinary]
fromEnum :: ChessColorBinary -> Int
$cfromEnum :: ChessColorBinary -> Int
toEnum :: Int -> ChessColorBinary
$ctoEnum :: Int -> ChessColorBinary
pred :: ChessColorBinary -> ChessColorBinary
$cpred :: ChessColorBinary -> ChessColorBinary
succ :: ChessColorBinary -> ChessColorBinary
$csucc :: ChessColorBinary -> ChessColorBinary
Enum, ChessColorBinary -> ChessColorBinary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChessColorBinary -> ChessColorBinary -> Bool
$c/= :: ChessColorBinary -> ChessColorBinary -> Bool
== :: ChessColorBinary -> ChessColorBinary -> Bool
$c== :: ChessColorBinary -> ChessColorBinary -> Bool
Eq, forall x. Rep ChessColorBinary x -> ChessColorBinary
forall x. ChessColorBinary -> Rep ChessColorBinary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChessColorBinary x -> ChessColorBinary
$cfrom :: forall x. ChessColorBinary -> Rep ChessColorBinary x
Generic, Eq ChessColorBinary
ChessColorBinary -> ChessColorBinary -> Bool
ChessColorBinary -> ChessColorBinary -> Ordering
ChessColorBinary -> ChessColorBinary -> ChessColorBinary
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChessColorBinary -> ChessColorBinary -> ChessColorBinary
$cmin :: ChessColorBinary -> ChessColorBinary -> ChessColorBinary
max :: ChessColorBinary -> ChessColorBinary -> ChessColorBinary
$cmax :: ChessColorBinary -> ChessColorBinary -> ChessColorBinary
>= :: ChessColorBinary -> ChessColorBinary -> Bool
$c>= :: ChessColorBinary -> ChessColorBinary -> Bool
> :: ChessColorBinary -> ChessColorBinary -> Bool
$c> :: ChessColorBinary -> ChessColorBinary -> Bool
<= :: ChessColorBinary -> ChessColorBinary -> Bool
$c<= :: ChessColorBinary -> ChessColorBinary -> Bool
< :: ChessColorBinary -> ChessColorBinary -> Bool
$c< :: ChessColorBinary -> ChessColorBinary -> Bool
compare :: ChessColorBinary -> ChessColorBinary -> Ordering
$ccompare :: ChessColorBinary -> ChessColorBinary -> Ordering
Ord, ReadPrec [ChessColorBinary]
ReadPrec ChessColorBinary
Int -> ReadS ChessColorBinary
ReadS [ChessColorBinary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChessColorBinary]
$creadListPrec :: ReadPrec [ChessColorBinary]
readPrec :: ReadPrec ChessColorBinary
$creadPrec :: ReadPrec ChessColorBinary
readList :: ReadS [ChessColorBinary]
$creadList :: ReadS [ChessColorBinary]
readsPrec :: Int -> ReadS ChessColorBinary
$creadsPrec :: Int -> ReadS ChessColorBinary
Read, Int -> ChessColorBinary -> ShowS
[ChessColorBinary] -> ShowS
ChessColorBinary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChessColorBinary] -> ShowS
$cshowList :: [ChessColorBinary] -> ShowS
show :: ChessColorBinary -> String
$cshow :: ChessColorBinary -> String
showsPrec :: Int -> ChessColorBinary -> ShowS
$cshowsPrec :: Int -> ChessColorBinary -> ShowS
Show)
instance Hashable ChessColorBinary
instance NFData ChessColorBinary
data ChessColor
=
White
|
Black
|
Neutral
deriving (ChessColor
forall a. a -> a -> Bounded a
maxBound :: ChessColor
$cmaxBound :: ChessColor
minBound :: ChessColor
$cminBound :: ChessColor
Bounded, Typeable ChessColor
ChessColor -> DataType
ChessColor -> Constr
(forall b. Data b => b -> b) -> ChessColor -> ChessColor
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ChessColor -> u
forall u. (forall d. Data d => d -> u) -> ChessColor -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColor -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColor -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChessColor -> m ChessColor
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessColor -> m ChessColor
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessColor
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessColor -> c ChessColor
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessColor)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChessColor)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessColor -> m ChessColor
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessColor -> m ChessColor
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessColor -> m ChessColor
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessColor -> m ChessColor
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChessColor -> m ChessColor
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChessColor -> m ChessColor
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ChessColor -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ChessColor -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ChessColor -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ChessColor -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColor -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColor -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColor -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessColor -> r
gmapT :: (forall b. Data b => b -> b) -> ChessColor -> ChessColor
$cgmapT :: (forall b. Data b => b -> b) -> ChessColor -> ChessColor
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChessColor)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChessColor)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessColor)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessColor)
dataTypeOf :: ChessColor -> DataType
$cdataTypeOf :: ChessColor -> DataType
toConstr :: ChessColor -> Constr
$ctoConstr :: ChessColor -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessColor
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessColor
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessColor -> c ChessColor
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessColor -> c ChessColor
Data, Int -> ChessColor
ChessColor -> Int
ChessColor -> [ChessColor]
ChessColor -> ChessColor
ChessColor -> ChessColor -> [ChessColor]
ChessColor -> ChessColor -> ChessColor -> [ChessColor]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ChessColor -> ChessColor -> ChessColor -> [ChessColor]
$cenumFromThenTo :: ChessColor -> ChessColor -> ChessColor -> [ChessColor]
enumFromTo :: ChessColor -> ChessColor -> [ChessColor]
$cenumFromTo :: ChessColor -> ChessColor -> [ChessColor]
enumFromThen :: ChessColor -> ChessColor -> [ChessColor]
$cenumFromThen :: ChessColor -> ChessColor -> [ChessColor]
enumFrom :: ChessColor -> [ChessColor]
$cenumFrom :: ChessColor -> [ChessColor]
fromEnum :: ChessColor -> Int
$cfromEnum :: ChessColor -> Int
toEnum :: Int -> ChessColor
$ctoEnum :: Int -> ChessColor
pred :: ChessColor -> ChessColor
$cpred :: ChessColor -> ChessColor
succ :: ChessColor -> ChessColor
$csucc :: ChessColor -> ChessColor
Enum, ChessColor -> ChessColor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChessColor -> ChessColor -> Bool
$c/= :: ChessColor -> ChessColor -> Bool
== :: ChessColor -> ChessColor -> Bool
$c== :: ChessColor -> ChessColor -> Bool
Eq, forall x. Rep ChessColor x -> ChessColor
forall x. ChessColor -> Rep ChessColor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChessColor x -> ChessColor
$cfrom :: forall x. ChessColor -> Rep ChessColor x
Generic, Eq ChessColor
ChessColor -> ChessColor -> Bool
ChessColor -> ChessColor -> Ordering
ChessColor -> ChessColor -> ChessColor
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChessColor -> ChessColor -> ChessColor
$cmin :: ChessColor -> ChessColor -> ChessColor
max :: ChessColor -> ChessColor -> ChessColor
$cmax :: ChessColor -> ChessColor -> ChessColor
>= :: ChessColor -> ChessColor -> Bool
$c>= :: ChessColor -> ChessColor -> Bool
> :: ChessColor -> ChessColor -> Bool
$c> :: ChessColor -> ChessColor -> Bool
<= :: ChessColor -> ChessColor -> Bool
$c<= :: ChessColor -> ChessColor -> Bool
< :: ChessColor -> ChessColor -> Bool
$c< :: ChessColor -> ChessColor -> Bool
compare :: ChessColor -> ChessColor -> Ordering
$ccompare :: ChessColor -> ChessColor -> Ordering
Ord, ReadPrec [ChessColor]
ReadPrec ChessColor
Int -> ReadS ChessColor
ReadS [ChessColor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChessColor]
$creadListPrec :: ReadPrec [ChessColor]
readPrec :: ReadPrec ChessColor
$creadPrec :: ReadPrec ChessColor
readList :: ReadS [ChessColor]
$creadList :: ReadS [ChessColor]
readsPrec :: Int -> ReadS ChessColor
$creadsPrec :: Int -> ReadS ChessColor
Read, Int -> ChessColor -> ShowS
[ChessColor] -> ShowS
ChessColor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChessColor] -> ShowS
$cshowList :: [ChessColor] -> ShowS
show :: ChessColor -> String
$cshow :: ChessColor -> String
showsPrec :: Int -> ChessColor -> ShowS
$cshowsPrec :: Int -> ChessColor -> ShowS
Show)
instance Hashable ChessColor
instance NFData ChessColor
data ChessPieceType
=
King
|
Queen
|
Rook
|
Bishop
|
Knight
|
Pawn
|
Equihopper
deriving (ChessPieceType
forall a. a -> a -> Bounded a
maxBound :: ChessPieceType
$cmaxBound :: ChessPieceType
minBound :: ChessPieceType
$cminBound :: ChessPieceType
Bounded, Typeable ChessPieceType
ChessPieceType -> DataType
ChessPieceType -> Constr
(forall b. Data b => b -> b) -> ChessPieceType -> ChessPieceType
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ChessPieceType -> u
forall u. (forall d. Data d => d -> u) -> ChessPieceType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPieceType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPieceType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessPieceType -> m ChessPieceType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessPieceType -> m ChessPieceType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessPieceType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessPieceType -> c ChessPieceType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessPieceType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessPieceType)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessPieceType -> m ChessPieceType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessPieceType -> m ChessPieceType
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessPieceType -> m ChessPieceType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessPieceType -> m ChessPieceType
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessPieceType -> m ChessPieceType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessPieceType -> m ChessPieceType
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ChessPieceType -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ChessPieceType -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ChessPieceType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ChessPieceType -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPieceType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPieceType -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPieceType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPieceType -> r
gmapT :: (forall b. Data b => b -> b) -> ChessPieceType -> ChessPieceType
$cgmapT :: (forall b. Data b => b -> b) -> ChessPieceType -> ChessPieceType
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessPieceType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessPieceType)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessPieceType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessPieceType)
dataTypeOf :: ChessPieceType -> DataType
$cdataTypeOf :: ChessPieceType -> DataType
toConstr :: ChessPieceType -> Constr
$ctoConstr :: ChessPieceType -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessPieceType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessPieceType
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessPieceType -> c ChessPieceType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessPieceType -> c ChessPieceType
Data, Int -> ChessPieceType
ChessPieceType -> Int
ChessPieceType -> [ChessPieceType]
ChessPieceType -> ChessPieceType
ChessPieceType -> ChessPieceType -> [ChessPieceType]
ChessPieceType
-> ChessPieceType -> ChessPieceType -> [ChessPieceType]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ChessPieceType
-> ChessPieceType -> ChessPieceType -> [ChessPieceType]
$cenumFromThenTo :: ChessPieceType
-> ChessPieceType -> ChessPieceType -> [ChessPieceType]
enumFromTo :: ChessPieceType -> ChessPieceType -> [ChessPieceType]
$cenumFromTo :: ChessPieceType -> ChessPieceType -> [ChessPieceType]
enumFromThen :: ChessPieceType -> ChessPieceType -> [ChessPieceType]
$cenumFromThen :: ChessPieceType -> ChessPieceType -> [ChessPieceType]
enumFrom :: ChessPieceType -> [ChessPieceType]
$cenumFrom :: ChessPieceType -> [ChessPieceType]
fromEnum :: ChessPieceType -> Int
$cfromEnum :: ChessPieceType -> Int
toEnum :: Int -> ChessPieceType
$ctoEnum :: Int -> ChessPieceType
pred :: ChessPieceType -> ChessPieceType
$cpred :: ChessPieceType -> ChessPieceType
succ :: ChessPieceType -> ChessPieceType
$csucc :: ChessPieceType -> ChessPieceType
Enum, ChessPieceType -> ChessPieceType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChessPieceType -> ChessPieceType -> Bool
$c/= :: ChessPieceType -> ChessPieceType -> Bool
== :: ChessPieceType -> ChessPieceType -> Bool
$c== :: ChessPieceType -> ChessPieceType -> Bool
Eq, forall x. Rep ChessPieceType x -> ChessPieceType
forall x. ChessPieceType -> Rep ChessPieceType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChessPieceType x -> ChessPieceType
$cfrom :: forall x. ChessPieceType -> Rep ChessPieceType x
Generic, Eq ChessPieceType
ChessPieceType -> ChessPieceType -> Bool
ChessPieceType -> ChessPieceType -> Ordering
ChessPieceType -> ChessPieceType -> ChessPieceType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChessPieceType -> ChessPieceType -> ChessPieceType
$cmin :: ChessPieceType -> ChessPieceType -> ChessPieceType
max :: ChessPieceType -> ChessPieceType -> ChessPieceType
$cmax :: ChessPieceType -> ChessPieceType -> ChessPieceType
>= :: ChessPieceType -> ChessPieceType -> Bool
$c>= :: ChessPieceType -> ChessPieceType -> Bool
> :: ChessPieceType -> ChessPieceType -> Bool
$c> :: ChessPieceType -> ChessPieceType -> Bool
<= :: ChessPieceType -> ChessPieceType -> Bool
$c<= :: ChessPieceType -> ChessPieceType -> Bool
< :: ChessPieceType -> ChessPieceType -> Bool
$c< :: ChessPieceType -> ChessPieceType -> Bool
compare :: ChessPieceType -> ChessPieceType -> Ordering
$ccompare :: ChessPieceType -> ChessPieceType -> Ordering
Ord, ReadPrec [ChessPieceType]
ReadPrec ChessPieceType
Int -> ReadS ChessPieceType
ReadS [ChessPieceType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChessPieceType]
$creadListPrec :: ReadPrec [ChessPieceType]
readPrec :: ReadPrec ChessPieceType
$creadPrec :: ReadPrec ChessPieceType
readList :: ReadS [ChessPieceType]
$creadList :: ReadS [ChessPieceType]
readsPrec :: Int -> ReadS ChessPieceType
$creadsPrec :: Int -> ReadS ChessPieceType
Read, Int -> ChessPieceType -> ShowS
[ChessPieceType] -> ShowS
ChessPieceType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChessPieceType] -> ShowS
$cshowList :: [ChessPieceType] -> ShowS
show :: ChessPieceType -> String
$cshow :: ChessPieceType -> String
showsPrec :: Int -> ChessPieceType -> ShowS
$cshowsPrec :: Int -> ChessPieceType -> ShowS
Show)
instance Hashable ChessPieceType
instance NFData ChessPieceType
data Rotate45
=
R45
|
R135
|
R225
|
R315
deriving (Rotate45
forall a. a -> a -> Bounded a
maxBound :: Rotate45
$cmaxBound :: Rotate45
minBound :: Rotate45
$cminBound :: Rotate45
Bounded, Typeable Rotate45
Rotate45 -> DataType
Rotate45 -> Constr
(forall b. Data b => b -> b) -> Rotate45 -> Rotate45
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Rotate45 -> u
forall u. (forall d. Data d => d -> u) -> Rotate45 -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Rotate45 -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Rotate45 -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Rotate45 -> m Rotate45
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Rotate45 -> m Rotate45
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Rotate45
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Rotate45 -> c Rotate45
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Rotate45)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Rotate45)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Rotate45 -> m Rotate45
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Rotate45 -> m Rotate45
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Rotate45 -> m Rotate45
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Rotate45 -> m Rotate45
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Rotate45 -> m Rotate45
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Rotate45 -> m Rotate45
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Rotate45 -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Rotate45 -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> Rotate45 -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Rotate45 -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Rotate45 -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Rotate45 -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Rotate45 -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Rotate45 -> r
gmapT :: (forall b. Data b => b -> b) -> Rotate45 -> Rotate45
$cgmapT :: (forall b. Data b => b -> b) -> Rotate45 -> Rotate45
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Rotate45)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Rotate45)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Rotate45)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Rotate45)
dataTypeOf :: Rotate45 -> DataType
$cdataTypeOf :: Rotate45 -> DataType
toConstr :: Rotate45 -> Constr
$ctoConstr :: Rotate45 -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Rotate45
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Rotate45
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Rotate45 -> c Rotate45
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Rotate45 -> c Rotate45
Data, Int -> Rotate45
Rotate45 -> Int
Rotate45 -> [Rotate45]
Rotate45 -> Rotate45
Rotate45 -> Rotate45 -> [Rotate45]
Rotate45 -> Rotate45 -> Rotate45 -> [Rotate45]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Rotate45 -> Rotate45 -> Rotate45 -> [Rotate45]
$cenumFromThenTo :: Rotate45 -> Rotate45 -> Rotate45 -> [Rotate45]
enumFromTo :: Rotate45 -> Rotate45 -> [Rotate45]
$cenumFromTo :: Rotate45 -> Rotate45 -> [Rotate45]
enumFromThen :: Rotate45 -> Rotate45 -> [Rotate45]
$cenumFromThen :: Rotate45 -> Rotate45 -> [Rotate45]
enumFrom :: Rotate45 -> [Rotate45]
$cenumFrom :: Rotate45 -> [Rotate45]
fromEnum :: Rotate45 -> Int
$cfromEnum :: Rotate45 -> Int
toEnum :: Int -> Rotate45
$ctoEnum :: Int -> Rotate45
pred :: Rotate45 -> Rotate45
$cpred :: Rotate45 -> Rotate45
succ :: Rotate45 -> Rotate45
$csucc :: Rotate45 -> Rotate45
Enum, Rotate45 -> Rotate45 -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Rotate45 -> Rotate45 -> Bool
$c/= :: Rotate45 -> Rotate45 -> Bool
== :: Rotate45 -> Rotate45 -> Bool
$c== :: Rotate45 -> Rotate45 -> Bool
Eq, forall x. Rep Rotate45 x -> Rotate45
forall x. Rotate45 -> Rep Rotate45 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Rotate45 x -> Rotate45
$cfrom :: forall x. Rotate45 -> Rep Rotate45 x
Generic, Eq Rotate45
Rotate45 -> Rotate45 -> Bool
Rotate45 -> Rotate45 -> Ordering
Rotate45 -> Rotate45 -> Rotate45
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Rotate45 -> Rotate45 -> Rotate45
$cmin :: Rotate45 -> Rotate45 -> Rotate45
max :: Rotate45 -> Rotate45 -> Rotate45
$cmax :: Rotate45 -> Rotate45 -> Rotate45
>= :: Rotate45 -> Rotate45 -> Bool
$c>= :: Rotate45 -> Rotate45 -> Bool
> :: Rotate45 -> Rotate45 -> Bool
$c> :: Rotate45 -> Rotate45 -> Bool
<= :: Rotate45 -> Rotate45 -> Bool
$c<= :: Rotate45 -> Rotate45 -> Bool
< :: Rotate45 -> Rotate45 -> Bool
$c< :: Rotate45 -> Rotate45 -> Bool
compare :: Rotate45 -> Rotate45 -> Ordering
$ccompare :: Rotate45 -> Rotate45 -> Ordering
Ord, ReadPrec [Rotate45]
ReadPrec Rotate45
Int -> ReadS Rotate45
ReadS [Rotate45]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Rotate45]
$creadListPrec :: ReadPrec [Rotate45]
readPrec :: ReadPrec Rotate45
$creadPrec :: ReadPrec Rotate45
readList :: ReadS [Rotate45]
$creadList :: ReadS [Rotate45]
readsPrec :: Int -> ReadS Rotate45
$creadsPrec :: Int -> ReadS Rotate45
Read, Int -> Rotate45 -> ShowS
[Rotate45] -> ShowS
Rotate45 -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Rotate45] -> ShowS
$cshowList :: [Rotate45] -> ShowS
show :: Rotate45 -> String
$cshow :: Rotate45 -> String
showsPrec :: Int -> Rotate45 -> ShowS
$cshowsPrec :: Int -> Rotate45 -> ShowS
Show)
instance Hashable Rotate45
instance NFData Rotate45
data ChessHybridType
=
KnightQueen
|
KnightRook
|
KnightBishop
deriving (ChessHybridType
forall a. a -> a -> Bounded a
maxBound :: ChessHybridType
$cmaxBound :: ChessHybridType
minBound :: ChessHybridType
$cminBound :: ChessHybridType
Bounded, Typeable ChessHybridType
ChessHybridType -> DataType
ChessHybridType -> Constr
(forall b. Data b => b -> b) -> ChessHybridType -> ChessHybridType
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ChessHybridType -> u
forall u. (forall d. Data d => d -> u) -> ChessHybridType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessHybridType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessHybridType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessHybridType -> m ChessHybridType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessHybridType -> m ChessHybridType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessHybridType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessHybridType -> c ChessHybridType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessHybridType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessHybridType)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessHybridType -> m ChessHybridType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessHybridType -> m ChessHybridType
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessHybridType -> m ChessHybridType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ChessHybridType -> m ChessHybridType
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessHybridType -> m ChessHybridType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ChessHybridType -> m ChessHybridType
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ChessHybridType -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ChessHybridType -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ChessHybridType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ChessHybridType -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessHybridType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessHybridType -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessHybridType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessHybridType -> r
gmapT :: (forall b. Data b => b -> b) -> ChessHybridType -> ChessHybridType
$cgmapT :: (forall b. Data b => b -> b) -> ChessHybridType -> ChessHybridType
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessHybridType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ChessHybridType)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessHybridType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessHybridType)
dataTypeOf :: ChessHybridType -> DataType
$cdataTypeOf :: ChessHybridType -> DataType
toConstr :: ChessHybridType -> Constr
$ctoConstr :: ChessHybridType -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessHybridType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessHybridType
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessHybridType -> c ChessHybridType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessHybridType -> c ChessHybridType
Data, Int -> ChessHybridType
ChessHybridType -> Int
ChessHybridType -> [ChessHybridType]
ChessHybridType -> ChessHybridType
ChessHybridType -> ChessHybridType -> [ChessHybridType]
ChessHybridType
-> ChessHybridType -> ChessHybridType -> [ChessHybridType]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ChessHybridType
-> ChessHybridType -> ChessHybridType -> [ChessHybridType]
$cenumFromThenTo :: ChessHybridType
-> ChessHybridType -> ChessHybridType -> [ChessHybridType]
enumFromTo :: ChessHybridType -> ChessHybridType -> [ChessHybridType]
$cenumFromTo :: ChessHybridType -> ChessHybridType -> [ChessHybridType]
enumFromThen :: ChessHybridType -> ChessHybridType -> [ChessHybridType]
$cenumFromThen :: ChessHybridType -> ChessHybridType -> [ChessHybridType]
enumFrom :: ChessHybridType -> [ChessHybridType]
$cenumFrom :: ChessHybridType -> [ChessHybridType]
fromEnum :: ChessHybridType -> Int
$cfromEnum :: ChessHybridType -> Int
toEnum :: Int -> ChessHybridType
$ctoEnum :: Int -> ChessHybridType
pred :: ChessHybridType -> ChessHybridType
$cpred :: ChessHybridType -> ChessHybridType
succ :: ChessHybridType -> ChessHybridType
$csucc :: ChessHybridType -> ChessHybridType
Enum, ChessHybridType -> ChessHybridType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChessHybridType -> ChessHybridType -> Bool
$c/= :: ChessHybridType -> ChessHybridType -> Bool
== :: ChessHybridType -> ChessHybridType -> Bool
$c== :: ChessHybridType -> ChessHybridType -> Bool
Eq, forall x. Rep ChessHybridType x -> ChessHybridType
forall x. ChessHybridType -> Rep ChessHybridType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChessHybridType x -> ChessHybridType
$cfrom :: forall x. ChessHybridType -> Rep ChessHybridType x
Generic, Eq ChessHybridType
ChessHybridType -> ChessHybridType -> Bool
ChessHybridType -> ChessHybridType -> Ordering
ChessHybridType -> ChessHybridType -> ChessHybridType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChessHybridType -> ChessHybridType -> ChessHybridType
$cmin :: ChessHybridType -> ChessHybridType -> ChessHybridType
max :: ChessHybridType -> ChessHybridType -> ChessHybridType
$cmax :: ChessHybridType -> ChessHybridType -> ChessHybridType
>= :: ChessHybridType -> ChessHybridType -> Bool
$c>= :: ChessHybridType -> ChessHybridType -> Bool
> :: ChessHybridType -> ChessHybridType -> Bool
$c> :: ChessHybridType -> ChessHybridType -> Bool
<= :: ChessHybridType -> ChessHybridType -> Bool
$c<= :: ChessHybridType -> ChessHybridType -> Bool
< :: ChessHybridType -> ChessHybridType -> Bool
$c< :: ChessHybridType -> ChessHybridType -> Bool
compare :: ChessHybridType -> ChessHybridType -> Ordering
$ccompare :: ChessHybridType -> ChessHybridType -> Ordering
Ord, ReadPrec [ChessHybridType]
ReadPrec ChessHybridType
Int -> ReadS ChessHybridType
ReadS [ChessHybridType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChessHybridType]
$creadListPrec :: ReadPrec [ChessHybridType]
readPrec :: ReadPrec ChessHybridType
$creadPrec :: ReadPrec ChessHybridType
readList :: ReadS [ChessHybridType]
$creadList :: ReadS [ChessHybridType]
readsPrec :: Int -> ReadS ChessHybridType
$creadsPrec :: Int -> ReadS ChessHybridType
Read, Int -> ChessHybridType -> ShowS
[ChessHybridType] -> ShowS
ChessHybridType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChessHybridType] -> ShowS
$cshowList :: [ChessHybridType] -> ShowS
show :: ChessHybridType -> String
$cshow :: ChessHybridType -> String
showsPrec :: Int -> ChessHybridType -> ShowS
$cshowsPrec :: Int -> ChessHybridType -> ShowS
Show)
instance Hashable ChessHybridType
instance NFData ChessHybridType
data ChessPiece
=
Chess90 ChessColor ChessPieceType Rotate90
|
Chess45Knight ChessColor Rotate45
|
ChessHybrid ChessHybridType ChessColorBinary
deriving (Typeable ChessPiece
ChessPiece -> DataType
ChessPiece -> Constr
(forall b. Data b => b -> b) -> ChessPiece -> ChessPiece
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ChessPiece -> u
forall u. (forall d. Data d => d -> u) -> ChessPiece -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPiece -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPiece -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChessPiece -> m ChessPiece
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessPiece -> m ChessPiece
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessPiece
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessPiece -> c ChessPiece
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessPiece)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChessPiece)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessPiece -> m ChessPiece
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessPiece -> m ChessPiece
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessPiece -> m ChessPiece
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ChessPiece -> m ChessPiece
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChessPiece -> m ChessPiece
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ChessPiece -> m ChessPiece
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ChessPiece -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ChessPiece -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ChessPiece -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ChessPiece -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPiece -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPiece -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPiece -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ChessPiece -> r
gmapT :: (forall b. Data b => b -> b) -> ChessPiece -> ChessPiece
$cgmapT :: (forall b. Data b => b -> b) -> ChessPiece -> ChessPiece
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChessPiece)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChessPiece)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessPiece)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ChessPiece)
dataTypeOf :: ChessPiece -> DataType
$cdataTypeOf :: ChessPiece -> DataType
toConstr :: ChessPiece -> Constr
$ctoConstr :: ChessPiece -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessPiece
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ChessPiece
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessPiece -> c ChessPiece
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ChessPiece -> c ChessPiece
Data, ChessPiece -> ChessPiece -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChessPiece -> ChessPiece -> Bool
$c/= :: ChessPiece -> ChessPiece -> Bool
== :: ChessPiece -> ChessPiece -> Bool
$c== :: ChessPiece -> ChessPiece -> Bool
Eq, forall x. Rep ChessPiece x -> ChessPiece
forall x. ChessPiece -> Rep ChessPiece x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChessPiece x -> ChessPiece
$cfrom :: forall x. ChessPiece -> Rep ChessPiece x
Generic, Eq ChessPiece
ChessPiece -> ChessPiece -> Bool
ChessPiece -> ChessPiece -> Ordering
ChessPiece -> ChessPiece -> ChessPiece
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChessPiece -> ChessPiece -> ChessPiece
$cmin :: ChessPiece -> ChessPiece -> ChessPiece
max :: ChessPiece -> ChessPiece -> ChessPiece
$cmax :: ChessPiece -> ChessPiece -> ChessPiece
>= :: ChessPiece -> ChessPiece -> Bool
$c>= :: ChessPiece -> ChessPiece -> Bool
> :: ChessPiece -> ChessPiece -> Bool
$c> :: ChessPiece -> ChessPiece -> Bool
<= :: ChessPiece -> ChessPiece -> Bool
$c<= :: ChessPiece -> ChessPiece -> Bool
< :: ChessPiece -> ChessPiece -> Bool
$c< :: ChessPiece -> ChessPiece -> Bool
compare :: ChessPiece -> ChessPiece -> Ordering
$ccompare :: ChessPiece -> ChessPiece -> Ordering
Ord, ReadPrec [ChessPiece]
ReadPrec ChessPiece
Int -> ReadS ChessPiece
ReadS [ChessPiece]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChessPiece]
$creadListPrec :: ReadPrec [ChessPiece]
readPrec :: ReadPrec ChessPiece
$creadPrec :: ReadPrec ChessPiece
readList :: ReadS [ChessPiece]
$creadList :: ReadS [ChessPiece]
readsPrec :: Int -> ReadS ChessPiece
$creadsPrec :: Int -> ReadS ChessPiece
Read, Int -> ChessPiece -> ShowS
[ChessPiece] -> ShowS
ChessPiece -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChessPiece] -> ShowS
$cshowList :: [ChessPiece] -> ShowS
show :: ChessPiece -> String
$cshow :: ChessPiece -> String
showsPrec :: Int -> ChessPiece -> ShowS
$cshowsPrec :: Int -> ChessPiece -> ShowS
Show)
instance Hashable ChessPiece
instance NFData ChessPiece
instance Arbitrary ChessColorBinary where
arbitrary :: Gen ChessColorBinary
arbitrary = forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum
instance Arbitrary ChessColor where
arbitrary :: Gen ChessColor
arbitrary = forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum
instance Arbitrary ChessPieceType where
arbitrary :: Gen ChessPieceType
arbitrary = forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum
instance Arbitrary ChessHybridType where
arbitrary :: Gen ChessHybridType
arbitrary = forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum
instance Arbitrary Rotate45 where
arbitrary :: Gen Rotate45
arbitrary = forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum
instance Arbitrary ChessPiece where
arbitrary :: Gen ChessPiece
arbitrary = forall a. [Gen a] -> Gen a
oneof [ChessColor -> ChessPieceType -> Rotate90 -> ChessPiece
Chess90 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => Gen a
arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => Gen a
arbitrary, ChessColor -> Rotate45 -> ChessPiece
Chess45Knight forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => Gen a
arbitrary, ChessHybridType -> ChessColorBinary -> ChessPiece
ChessHybrid forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Arbitrary a => Gen a
arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Arbitrary a => Gen a
arbitrary]
pattern Grasshopper :: ChessColor -> ChessPiece
pattern $bGrasshopper :: ChessColor -> ChessPiece
$mGrasshopper :: forall {r}. ChessPiece -> (ChessColor -> r) -> ((# #) -> r) -> r
Grasshopper c = Chess90 c Queen R180
pattern Nightrider :: ChessColor -> ChessPiece
pattern $bNightrider :: ChessColor -> ChessPiece
$mNightrider :: forall {r}. ChessPiece -> (ChessColor -> r) -> ((# #) -> r) -> r
Nightrider c = Chess90 c Knight R180
pattern Amazon :: ChessColorBinary -> ChessPiece
pattern $bAmazon :: ChessColorBinary -> ChessPiece
$mAmazon :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
Amazon c = ChessHybrid KnightQueen c
pattern Terror :: ChessColorBinary -> ChessPiece
pattern $bTerror :: ChessColorBinary -> ChessPiece
$mTerror :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
Terror c = ChessHybrid KnightQueen c
pattern OmnipotentQueen :: ChessColorBinary -> ChessPiece
pattern $bOmnipotentQueen :: ChessColorBinary -> ChessPiece
$mOmnipotentQueen :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
OmnipotentQueen c = ChessHybrid KnightQueen c
pattern Superqueen :: ChessColorBinary -> ChessPiece
pattern $bSuperqueen :: ChessColorBinary -> ChessPiece
$mSuperqueen :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
Superqueen c = ChessHybrid KnightQueen c
pattern Chancellor :: ChessColorBinary -> ChessPiece
pattern $bChancellor :: ChessColorBinary -> ChessPiece
$mChancellor :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
Chancellor c = ChessHybrid KnightRook c
pattern Marshall :: ChessColorBinary -> ChessPiece
pattern $bMarshall :: ChessColorBinary -> ChessPiece
$mMarshall :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
Marshall c = ChessHybrid KnightRook c
pattern Empress :: ChessColorBinary -> ChessPiece
pattern $bEmpress :: ChessColorBinary -> ChessPiece
$mEmpress :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
Empress c = ChessHybrid KnightRook c
pattern Cardinal :: ChessColorBinary -> ChessPiece
pattern $bCardinal :: ChessColorBinary -> ChessPiece
$mCardinal :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
Cardinal c = ChessHybrid KnightBishop c
pattern Princess :: ChessColorBinary -> ChessPiece
pattern $bPrincess :: ChessColorBinary -> ChessPiece
$mPrincess :: forall {r}.
ChessPiece -> (ChessColorBinary -> r) -> ((# #) -> r) -> r
Princess c = ChessHybrid KnightBishop c
_chessValue :: ChessPieceType -> ChessColor -> Int
_chessValue :: ChessPieceType -> ChessColor -> Int
_chessValue ChessPieceType
t ChessColor
c = Int
6 forall a. Num a => a -> a -> a
* forall a. Enum a => a -> Int
fromEnum ChessColor
c forall a. Num a => a -> a -> a
+ forall a. Enum a => a -> Int
fromEnum ChessPieceType
t
chessPiece ::
ChessPiece ->
Char
chessPiece :: ChessPiece -> Char
chessPiece (Chess90 ChessColor
c ChessPieceType
Equihopper Rotate90
r) = Int -> Char
chr (Int
3 forall a. Num a => a -> a -> a
* forall a. Integral a => a -> a -> a
mod (forall a. Enum a => a -> Int
fromEnum Rotate90
r) Int
2 forall a. Num a => a -> a -> a
+ forall a. Enum a => a -> Int
fromEnum ChessColor
c forall a. Num a => a -> a -> a
+ Int
0x1fa48)
chessPiece (Chess90 ChessColor
Neutral ChessPieceType
t Rotate90
R0) = Int -> Char
chr (Int
0x1fa00 forall a. Bits a => a -> a -> a
.|. forall a. Enum a => a -> Int
fromEnum ChessPieceType
t)
chessPiece (Chess90 ChessColor
c ChessPieceType
t Rotate90
R0) = Int -> Char
chr (ChessPieceType -> ChessColor -> Int
_chessValue ChessPieceType
t ChessColor
c forall a. Num a => a -> a -> a
+ Int
0x2654)
chessPiece (Chess90 ChessColor
c ChessPieceType
t Rotate90
r) = Int -> Char
chr (Int
0x15 forall a. Num a => a -> a -> a
* forall a. Enum a => a -> Int
fromEnum Rotate90
r forall a. Num a => a -> a -> a
+ ChessPieceType -> ChessColor -> Int
_chessValue ChessPieceType
t ChessColor
c forall a. Num a => a -> a -> a
+ Int
0x1f9f4)
chessPiece (Chess45Knight ChessColor
c Rotate45
r) = Int -> Char
chr (Int
0x15 forall a. Num a => a -> a -> a
* forall a. Enum a => a -> Int
fromEnum Rotate45
r forall a. Num a => a -> a -> a
+ forall a. Enum a => a -> Int
fromEnum ChessColor
c forall a. Num a => a -> a -> a
+ Int
0x1fa06)
chessPiece (ChessHybrid ChessHybridType
t ChessColorBinary
c) = Int -> Char
chr (Int
3 forall a. Num a => a -> a -> a
* forall a. Enum a => a -> Int
fromEnum ChessColorBinary
c forall a. Num a => a -> a -> a
+ forall a. Enum a => a -> Int
fromEnum ChessHybridType
t forall a. Num a => a -> a -> a
+ Int
0x1fa4e)