Hacker News new | ask | show | jobs
by sdwr 1401 days ago
Thanks for replying!

If I understand correctly, GATs are about being able to change compiler assumptions about data types in user code? Generics acting on the compiler?

How is that helpful? Is it that you're trying to skip all the language boilerplate around creating objects? Are there any risks/footguns to that approach?

Generic type-driven code makes my head hurt, let me know if I'm somewhat close

1 comments

I don't understand your question.

GATs allow traits to abstract over associated types that are themselves to some degree abstract. In this case, it's necessary to do the relevant trait machinery around lifetime transformation since we need to be able to talk about "a replaceable lifetime of a type" in a generic way.