bindingContentsEnvItems :: (Ord i) => Lam.BindingWithId i -> [(i, Eval.Val i)]
bindingContentsEnvItems (Id.WithId i (Identity (Lam.Binding _ contents))) = go contents
  where go (Lam.BindingExp boundExp) = [(Lam.expTopId boundExp, Eval.Thunk [] Set.empty Map.empty (Id.WithId (Lam.expTopId boundExp) . Identity . Eval.ThunkExp $ boundExp))]
        go (Lam.BindingTypeish (Lam.Record fields)) = [(i, Eval.Thunk [fieldIds] (Set.fromList fieldIds) Map.empty (Id.WithId i . Identity $ Eval.ThunkRecord))]
          where fieldIds = (^. Id.id) <$> fields
        go (Lam.BindingTypeish (Lam.Union _)) = []
bindingContentsEnvItems :: (Ord i) => Lam.BindingWithId i -> [(i, Eval.Val i)]
bindingContentsEnvItems (Id.WithId i (Identity (Lam.Binding _ contents))) = go contents
  where go (Lam.BindingExp boundExp) = [(Lam.expTopId boundExp, Eval.Thunk [] Set.empty Map.empty (Id.WithId (Lam.expTopId boundExp) . Identity . Eval.ThunkExp $ boundExp))]
        go (Lam.BindingTypeish (Lam.Record fields)) = [(i, Eval.Thunk [fieldIds] (Set.fromList fieldIds) Map.empty (Id.WithId i . Identity $ Eval.ThunkRecord))]
          where fieldIds = (^. Id.id) <$> fields
        go (Lam.BindingTypeish (Lam.Union _)) = []
bindingContentsEnvItems (Id.WithId i (Identity (Lam.Binding _ contents))) = go contents
  where go (Lam.BindingExp boundExp) = [(Lam.expTopId boundExp, Eval.Thunk [] Set.empty Map.empty (Id.WithId (Lam.expTopId boundExp) . Identity . Eval.ThunkExp $ boundExp))]
        go (Lam.BindingTypeish (Lam.Record fields)) = [(i, Eval.Thunk [fieldIds] (Set.fromList fieldIds) Map.empty (Id.WithId i . Identity $ Eval.ThunkRecord))]
          where fieldIds = (^. Id.id) <$> fields
        go (Lam.BindingTypeish (Lam.Union _)) = []