I have no idea if it'll work without fixes, but for sure it looks a lot like the simpler version I wrote by myself. It's really impressive what ChatGPT is able to generate with just a few hints on names/parameters/types and a few iterations with human feedback.