move move = do
    color_                                              <- mapM has ["B", "W"]
    [number_, overtimeMovesBlack_, overtimeMovesWhite_] <- mapM (transMap number) ["MN", "OB", "OW"]
    [timeBlack_, timeWhite_]                            <- mapM (transMap real  ) ["BL", "WL"]
    let partialMove = emptyMove {
            T.number                = number_,
            T.timeBlack             = timeBlack_,
            T.timeWhite             = timeWhite_,
            T.overtimeMovesBlack    = overtimeMovesBlack_,
            T.overtimeMovesWhite    = overtimeMovesWhite_
            }
    case color_ of
        [False, False] -> warnAll MovelessAnnotationOmitted ["KO", "BM", "DO", "IT", "TE"] >> return partialMove
        [True , True ] -> dieEarliest ConcurrentBlackAndWhiteMove ["B", "W"]
        [black, white] -> let color = if black then Black else White in do
            Just move   <- fmap msum . mapM (transMap move) $ ["B", "W"]
            illegal     <- fmap (maybe Possibly (const Definitely)) (transMap none "KO")
            annotations <- mapM has ["BM", "DO", "IT", "TE"]
            quality     <- case annotations of
                [False, False, False, False] -> return Nothing
                [True , False, False, False] -> fmap (fmap Bad ) (transMap double "BM")
                [False, False, False, True ] -> fmap (fmap Good) (transMap double "TE")
                [False, True , False, False] -> transMap none "DO" >> return (Just Doubtful   )
                [False, False, True , False] -> transMap none "IT" >> return (Just Interesting)
                _                            -> dieEarliest ConcurrentAnnotations ["BM", "DO", "IT", "TE"]
            return partialMove { T.move = Just (color, move), T.illegal = illegal, T.quality = quality }
-- }}}
-- setup properties {{{
move move = do
    color_                                              <- mapM has ["B", "W"]
    [number_, overtimeMovesBlack_, overtimeMovesWhite_] <- mapM (transMap number) ["MN", "OB", "OW"]
    [timeBlack_, timeWhite_]                            <- mapM (transMap real  ) ["BL", "WL"]
    let partialMove = emptyMove {
            T.number                = number_,
            T.timeBlack             = timeBlack_,
            T.timeWhite             = timeWhite_,
            T.overtimeMovesBlack    = overtimeMovesBlack_,
            T.overtimeMovesWhite    = overtimeMovesWhite_
            }
    case color_ of
        [False, False] -> warnAll MovelessAnnotationOmitted ["KO", "BM", "DO", "IT", "TE"] >> return partialMove
        [True , True ] -> dieEarliest ConcurrentBlackAndWhiteMove ["B", "W"]
        [black, white] -> let color = if black then Black else White in do
            Just move   <- fmap msum . mapM (transMap move) $ ["B", "W"]
            illegal     <- fmap (maybe Possibly (const Definitely)) (transMap none "KO")
            annotations <- mapM has ["BM", "DO", "IT", "TE"]
            quality     <- case annotations of
                [False, False, False, False] -> return Nothing
                [True , False, False, False] -> fmap (fmap Bad ) (transMap double "BM")
                [False, False, False, True ] -> fmap (fmap Good) (transMap double "TE")
                [False, True , False, False] -> transMap none "DO" >> return (Just Doubtful   )
                [False, False, True , False] -> transMap none "IT" >> return (Just Interesting)
                _                            -> dieEarliest ConcurrentAnnotations ["BM", "DO", "IT", "TE"]
            return partialMove { T.move = Just (color, move), T.illegal = illegal, T.quality = quality }
-- }}}
-- setup properties {{{
move move = do
    color_                                              <- mapM has ["B", "W"]
    [number_, overtimeMovesBlack_, overtimeMovesWhite_] <- mapM (transMap number) ["MN", "OB", "OW"]
    [timeBlack_, timeWhite_]                            <- mapM (transMap real  ) ["BL", "WL"]
    let partialMove = emptyMove {
            T.number                = number_,
            T.timeBlack             = timeBlack_,
            T.timeWhite             = timeWhite_,
            T.overtimeMovesBlack    = overtimeMovesBlack_,
            T.overtimeMovesWhite    = overtimeMovesWhite_
            }
    case color_ of
        [False, False] -> warnAll MovelessAnnotationOmitted ["KO", "BM", "DO", "IT", "TE"] >> return partialMove
        [True , True ] -> dieEarliest ConcurrentBlackAndWhiteMove ["B", "W"]
        [black, white] -> let color = if black then Black else White in do
            Just move   <- fmap msum . mapM (transMap move) $ ["B", "W"]
            illegal     <- fmap (maybe Possibly (const Definitely)) (transMap none "KO")
            annotations <- mapM has ["BM", "DO", "IT", "TE"]
            quality     <- case annotations of
                [False, False, False, False] -> return Nothing
                [True , False, False, False] -> fmap (fmap Bad ) (transMap double "BM")
                [False, False, False, True ] -> fmap (fmap Good) (transMap double "TE")
                [False, True , False, False] -> transMap none "DO" >> return (Just Doubtful   )
                [False, False, True , False] -> transMap none "IT" >> return (Just Interesting)
                _                            -> dieEarliest ConcurrentAnnotations ["BM", "DO", "IT", "TE"]
            return partialMove { T.move = Just (color, move), T.illegal = illegal, T.quality = quality }
-- }}}
-- setup properties {{{