toSteps ::
  Vec       {- ^ initial direction  -} ->
  [Command] {- ^ commands           -} ->
  [Vec]     {- ^ list of directions -}
toSteps dir0 cmds = concat (snd (mapAccumL aux dir0 cmds))
  where
    aux dir (Command lr steps) =
      let dir' = turn lr dir
      in (dir', replicate steps dir')
toSteps ::
  Vec       {- ^ initial direction  -} ->
  [Command] {- ^ commands           -} ->
  [Vec]
toSteps dir0 cmds = concat (snd (mapAccumL aux dir0 cmds))
  where
    aux dir (Command lr steps) =
      let dir' = turn lr dir
      in (dir', replicate steps dir')
toSteps dir0 cmds = concat (snd (mapAccumL aux dir0 cmds))
  where
    aux dir (Command lr steps) =
      let dir' = turn lr dir
      in (dir', replicate steps dir')