rebuildATA
    :: SyntacticAcc f
    => RebuildAcc acc
    -> (forall t'. Arrays t' => Idx aenv t' -> f acc aenv' t')
    -> Atuple (acc aenv)  t
    -> Atuple (acc aenv') t
rebuildATA k v atup =
  case atup of
    NilAtup      -> NilAtup
    SnocAtup t a -> rebuildATA k v t `SnocAtup` k v a


-- Rebuilding scalar expressions
--
rebuildATA
    :: SyntacticAcc f
    => RebuildAcc acc
    -> (forall t'. Arrays t' => Idx aenv t' -> f acc aenv' t')
    -> Atuple (acc aenv)  t
    -> Atuple (acc aenv') t
rebuildATA k v atup =
  case atup of
    NilAtup      -> NilAtup
    SnocAtup t a -> rebuildATA k v t `SnocAtup` k v a


-- Rebuilding scalar expressions
--
rebuildATA k v atup =
  case atup of
    NilAtup      -> NilAtup
    SnocAtup t a -> rebuildATA k v t `SnocAtup` k v a


-- Rebuilding scalar expressions
--