actProductionSymbol :: Int -> Int -> Action -> S.State DocLR0 ()
actProductionSymbol i j action =
  modify $ \doc@DocLR0{slide,grammar=Doc g govs} ->
    let (ps1, Doc p povs : ps2) = splitAt i g
        (ss1, Doc s sovs : ss2) = splitAt j p
        p' = ss1 ++ Doc s ((slide,action):sovs) : ss2
        g' = ps1 ++ Doc p' povs : ps2
    in doc{grammar=Doc g' govs}
actProductionSymbol :: Int -> Int -> Action -> S.State DocLR0 ()
actProductionSymbol i j action =
  modify $ \doc@DocLR0{slide,grammar=Doc g govs} ->
    let (ps1, Doc p povs : ps2) = splitAt i g
        (ss1, Doc s sovs : ss2) = splitAt j p
        p' = ss1 ++ Doc s ((slide,action):sovs) : ss2
        g' = ps1 ++ Doc p' povs : ps2
    in doc{grammar=Doc g' govs}
actProductionSymbol i j action =
  modify $ \doc@DocLR0{slide,grammar=Doc g govs} ->
    let (ps1, Doc p povs : ps2) = splitAt i g
        (ss1, Doc s sovs : ss2) = splitAt j p
        p' = ss1 ++ Doc s ((slide,action):sovs) : ss2
        g' = ps1 ++ Doc p' povs : ps2
    in doc{grammar=Doc g' govs}