validateOrders :: V.Vector (PlayerId, V.Vector Order)
    -> Either Faults (Order, Order)
validateOrders rawOrders =
    if V.null faults
    then
        let [a, b] = foldMap (V.take 1 . snd) rawOrders
        in Right (a, b)
    else Left faults
    where
    faults = V.fromList (mapMaybe go (V.toList rawOrders))
    go (p, []) = Just (p, (pure (Fault "no moves")))
    go (_, [_]) = Nothing
    go (p, _) = Just (p, (pure (Fault "multiple moves")))
validateOrders :: V.Vector (PlayerId, V.Vector Order)
    -> Either Faults (Order, Order)
validateOrders rawOrders =
    if V.null faults
    then
        let [a, b] = foldMap (V.take 1 . snd) rawOrders
        in Right (a, b)
    else Left faults
    where
    faults = V.fromList (mapMaybe go (V.toList rawOrders))
    go (p, []) = Just (p, (pure (Fault "no moves")))
    go (_, [_]) = Nothing
    go (p, _) = Just (p, (pure (Fault "multiple moves")))
validateOrders rawOrders =
    if V.null faults
    then
        let [a, b] = foldMap (V.take 1 . snd) rawOrders
        in Right (a, b)
    else Left faults
    where
    faults = V.fromList (mapMaybe go (V.toList rawOrders))
    go (p, []) = Just (p, (pure (Fault "no moves")))
    go (_, [_]) = Nothing
    go (p, _) = Just (p, (pure (Fault "multiple moves")))