Well, if you ask it to write a library at the start, it's likely it will not do that well. Start small, spoon feed some examples.
Why can't you just pass any of those to an AI?
That is a heavily symbolic exercise. I will "read" the spec, but I will not pronounce it in literal audible English in my head (I'm a better reader than that.)
I write Haskell tho so maybe I'm biased. I do not have an inner narrative when programming ever.
Actually writing code is the fun and easy bit.