module BishBosh.Input.StandardOpeningOptions(
MatchSwitches,
StandardOpeningOptions(
),
tag,
mkStandardOpeningOptions,
getMatchSwitches
) where
import BishBosh.Data.Bool()
import qualified BishBosh.Text.ShowList as Text.ShowList
import qualified Control.DeepSeq
import qualified Data.Default
import qualified Text.XML.HXT.Arrow.Pickle as HXT
tag :: String
tag :: String
tag = String
"standardOpeningOptions"
tryToMatchMovesTag :: String
tryToMatchMovesTag :: String
tryToMatchMovesTag = String
"tryToMatchMoves"
tryToMatchViaJoiningMoveTag :: String
tryToMatchViaJoiningMoveTag :: String
tryToMatchViaJoiningMoveTag = String
"tryToMatchViaJoiningMove"
tryToMatchColourFlippedPositionTag :: String
tryToMatchColourFlippedPositionTag :: String
tryToMatchColourFlippedPositionTag = String
"tryToMatchColourFlippedPosition"
type TryToMatchMoves = Bool
type TryToMatchViaJoiningMove = Bool
type TryToMatchColourFlippedPosition = Bool
type MatchSwitches = (TryToMatchMoves, TryToMatchViaJoiningMove, TryToMatchColourFlippedPosition)
data StandardOpeningOptions = MkStandardOpeningOptions {
StandardOpeningOptions -> TryToMatchMoves
getTryToMatchMoves :: TryToMatchMoves,
StandardOpeningOptions -> TryToMatchMoves
getTryToMatchViaJoiningMove :: TryToMatchViaJoiningMove,
StandardOpeningOptions -> TryToMatchMoves
getTryToMatchColourFlippedPosition :: TryToMatchColourFlippedPosition
} deriving StandardOpeningOptions -> StandardOpeningOptions -> TryToMatchMoves
(StandardOpeningOptions
-> StandardOpeningOptions -> TryToMatchMoves)
-> (StandardOpeningOptions
-> StandardOpeningOptions -> TryToMatchMoves)
-> Eq StandardOpeningOptions
forall a.
(a -> a -> TryToMatchMoves) -> (a -> a -> TryToMatchMoves) -> Eq a
/= :: StandardOpeningOptions -> StandardOpeningOptions -> TryToMatchMoves
$c/= :: StandardOpeningOptions -> StandardOpeningOptions -> TryToMatchMoves
== :: StandardOpeningOptions -> StandardOpeningOptions -> TryToMatchMoves
$c== :: StandardOpeningOptions -> StandardOpeningOptions -> TryToMatchMoves
Eq
instance Control.DeepSeq.NFData StandardOpeningOptions where
rnf :: StandardOpeningOptions -> ()
rnf MkStandardOpeningOptions {
getTryToMatchMoves :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchMoves = TryToMatchMoves
tryToMatchMoves,
getTryToMatchViaJoiningMove :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchViaJoiningMove = TryToMatchMoves
tryToMatchViaJoiningMove,
getTryToMatchColourFlippedPosition :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchColourFlippedPosition = TryToMatchMoves
tryToMatchColourFlippedPosition
} = (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves) -> ()
forall a. NFData a => a -> ()
Control.DeepSeq.rnf (TryToMatchMoves
tryToMatchMoves, TryToMatchMoves
tryToMatchViaJoiningMove, TryToMatchMoves
tryToMatchColourFlippedPosition)
instance Show StandardOpeningOptions where
showsPrec :: Int -> StandardOpeningOptions -> ShowS
showsPrec Int
_ MkStandardOpeningOptions {
getTryToMatchMoves :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchMoves = TryToMatchMoves
tryToMatchMoves,
getTryToMatchViaJoiningMove :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchViaJoiningMove = TryToMatchMoves
tryToMatchViaJoiningMove,
getTryToMatchColourFlippedPosition :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchColourFlippedPosition = TryToMatchMoves
tryToMatchColourFlippedPosition
} = [(String, ShowS)] -> ShowS
Text.ShowList.showsAssociationList' [
(
String
tryToMatchMovesTag,
TryToMatchMoves -> ShowS
forall a. Show a => a -> ShowS
shows TryToMatchMoves
tryToMatchMoves
), (
String
tryToMatchViaJoiningMoveTag,
TryToMatchMoves -> ShowS
forall a. Show a => a -> ShowS
shows TryToMatchMoves
tryToMatchViaJoiningMove
), (
String
tryToMatchColourFlippedPositionTag,
TryToMatchMoves -> ShowS
forall a. Show a => a -> ShowS
shows TryToMatchMoves
tryToMatchColourFlippedPosition
)
]
instance Data.Default.Default StandardOpeningOptions where
def :: StandardOpeningOptions
def = MkStandardOpeningOptions :: TryToMatchMoves
-> TryToMatchMoves -> TryToMatchMoves -> StandardOpeningOptions
MkStandardOpeningOptions {
getTryToMatchMoves :: TryToMatchMoves
getTryToMatchMoves = TryToMatchMoves
True,
getTryToMatchViaJoiningMove :: TryToMatchMoves
getTryToMatchViaJoiningMove = TryToMatchMoves
True,
getTryToMatchColourFlippedPosition :: TryToMatchMoves
getTryToMatchColourFlippedPosition = TryToMatchMoves
True
}
instance HXT.XmlPickler StandardOpeningOptions where
xpickle :: PU StandardOpeningOptions
xpickle = StandardOpeningOptions
-> PU StandardOpeningOptions -> PU StandardOpeningOptions
forall a. Eq a => a -> PU a -> PU a
HXT.xpDefault StandardOpeningOptions
forall a. Default a => a
Data.Default.def (PU StandardOpeningOptions -> PU StandardOpeningOptions)
-> (PU (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
-> PU StandardOpeningOptions)
-> PU (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
-> PU StandardOpeningOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> PU StandardOpeningOptions -> PU StandardOpeningOptions
forall a. String -> PU a -> PU a
HXT.xpElem String
tag (PU StandardOpeningOptions -> PU StandardOpeningOptions)
-> (PU (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
-> PU StandardOpeningOptions)
-> PU (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
-> PU StandardOpeningOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
-> StandardOpeningOptions,
StandardOpeningOptions
-> (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves))
-> PU (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
-> PU StandardOpeningOptions
forall a b. (a -> b, b -> a) -> PU a -> PU b
HXT.xpWrap (
\(TryToMatchMoves
a, TryToMatchMoves
b, TryToMatchMoves
c) -> TryToMatchMoves
-> TryToMatchMoves -> TryToMatchMoves -> StandardOpeningOptions
mkStandardOpeningOptions TryToMatchMoves
a TryToMatchMoves
b TryToMatchMoves
c,
\MkStandardOpeningOptions {
getTryToMatchMoves :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchMoves = TryToMatchMoves
tryToMatchMoves,
getTryToMatchViaJoiningMove :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchViaJoiningMove = TryToMatchMoves
tryToMatchViaJoiningMove,
getTryToMatchColourFlippedPosition :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchColourFlippedPosition = TryToMatchMoves
tryToMatchColourFlippedPosition
} -> (TryToMatchMoves
tryToMatchMoves, TryToMatchMoves
tryToMatchViaJoiningMove, TryToMatchMoves
tryToMatchColourFlippedPosition)
) (PU (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
-> PU StandardOpeningOptions)
-> PU (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
-> PU StandardOpeningOptions
forall a b. (a -> b) -> a -> b
$ PU TryToMatchMoves
-> PU TryToMatchMoves
-> PU TryToMatchMoves
-> PU (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
forall a b c. PU a -> PU b -> PU c -> PU (a, b, c)
HXT.xpTriple(
StandardOpeningOptions -> TryToMatchMoves
getTryToMatchMoves StandardOpeningOptions
def TryToMatchMoves -> PU TryToMatchMoves -> PU TryToMatchMoves
forall a. Eq a => a -> PU a -> PU a
`HXT.xpDefault` String -> PU TryToMatchMoves -> PU TryToMatchMoves
forall a. String -> PU a -> PU a
HXT.xpAttr String
tryToMatchMovesTag PU TryToMatchMoves
forall a. XmlPickler a => PU a
HXT.xpickle
) (
StandardOpeningOptions -> TryToMatchMoves
getTryToMatchViaJoiningMove StandardOpeningOptions
def TryToMatchMoves -> PU TryToMatchMoves -> PU TryToMatchMoves
forall a. Eq a => a -> PU a -> PU a
`HXT.xpDefault` String -> PU TryToMatchMoves -> PU TryToMatchMoves
forall a. String -> PU a -> PU a
HXT.xpAttr String
tryToMatchViaJoiningMoveTag PU TryToMatchMoves
forall a. XmlPickler a => PU a
HXT.xpickle
) (
StandardOpeningOptions -> TryToMatchMoves
getTryToMatchColourFlippedPosition StandardOpeningOptions
def TryToMatchMoves -> PU TryToMatchMoves -> PU TryToMatchMoves
forall a. Eq a => a -> PU a -> PU a
`HXT.xpDefault` String -> PU TryToMatchMoves -> PU TryToMatchMoves
forall a. String -> PU a -> PU a
HXT.xpAttr String
tryToMatchColourFlippedPositionTag PU TryToMatchMoves
forall a. XmlPickler a => PU a
HXT.xpickle
) where
def :: StandardOpeningOptions
def = StandardOpeningOptions
forall a. Default a => a
Data.Default.def
mkStandardOpeningOptions
:: TryToMatchMoves
-> TryToMatchViaJoiningMove
-> TryToMatchColourFlippedPosition
-> StandardOpeningOptions
mkStandardOpeningOptions :: TryToMatchMoves
-> TryToMatchMoves -> TryToMatchMoves -> StandardOpeningOptions
mkStandardOpeningOptions TryToMatchMoves
tryToMatchMoves TryToMatchMoves
tryToMatchViaJoiningMove TryToMatchMoves
tryToMatchColourFlippedPosition = MkStandardOpeningOptions :: TryToMatchMoves
-> TryToMatchMoves -> TryToMatchMoves -> StandardOpeningOptions
MkStandardOpeningOptions {
getTryToMatchMoves :: TryToMatchMoves
getTryToMatchMoves = TryToMatchMoves
tryToMatchMoves,
getTryToMatchViaJoiningMove :: TryToMatchMoves
getTryToMatchViaJoiningMove = TryToMatchMoves
tryToMatchViaJoiningMove,
getTryToMatchColourFlippedPosition :: TryToMatchMoves
getTryToMatchColourFlippedPosition = TryToMatchMoves
tryToMatchColourFlippedPosition
}
getMatchSwitches :: StandardOpeningOptions -> MatchSwitches
getMatchSwitches :: StandardOpeningOptions
-> (TryToMatchMoves, TryToMatchMoves, TryToMatchMoves)
getMatchSwitches MkStandardOpeningOptions {
getTryToMatchMoves :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchMoves = TryToMatchMoves
tryToMatchMoves,
getTryToMatchViaJoiningMove :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchViaJoiningMove = TryToMatchMoves
tryToMatchViaJoiningMove,
getTryToMatchColourFlippedPosition :: StandardOpeningOptions -> TryToMatchMoves
getTryToMatchColourFlippedPosition = TryToMatchMoves
tryToMatchColourFlippedPosition
} = (TryToMatchMoves
tryToMatchMoves, TryToMatchMoves
tryToMatchViaJoiningMove, TryToMatchMoves
tryToMatchColourFlippedPosition)