typeCheckType (L _ (T.RecordType fields)) = do
  fieldmap <- foldrM (\field e -> (flip (:) e) <$> typeCheckField field) [] fields
  id <- getUniqueEff #id
  pure $ TRecord fieldmap id
typeCheckType (L _ (T.ArrayType typeid)) = do
  ty <- lookupTypeIdEff typeid