rebuildFE
    :: SyntacticExp f
    => (forall t'. Elt t' => Idx env t' -> f acc env' aenv t')
    -> PreOpenFun acc env  aenv t
    -> PreOpenFun acc env' aenv t
rebuildFE v fun =
  case fun of
    Body e      -> Body (rebuildE v e)
    Lam f       -> Lam (rebuildFE (shiftE v) f)


-- Array expressions
-- -----------------
rebuildFE
    :: SyntacticExp f
    => (forall t'. Elt t' => Idx env t' -> f acc env' aenv t')
    -> PreOpenFun acc env  aenv t
    -> PreOpenFun acc env' aenv t
rebuildFE v fun =
  case fun of
    Body e      -> Body (rebuildE v e)
    Lam f       -> Lam (rebuildFE (shiftE v) f)


-- Array expressions
-- -----------------
rebuildFE v fun =
  case fun of
    Body e      -> Body (rebuildE v e)
    Lam f       -> Lam (rebuildFE (shiftE v) f)


-- Array expressions
-- -----------------