| ▲ | solomonb 13 hours ago | ||||||||||||||||||||||||||||
I don't know how to answer this. I find that the quality of claude's output in any language is highly dependent on your skill at prompting it and what context you can provide. Sometimes I might give it type signatures and heavily micromanage it but other times not. I almost always ask claude to develop a plan and architecture which I review before having it produce code. Here is an example where I literally just told claude I wanted generic instances for these type classes and we had a brief back and forth about the approach then it one shotted this entire module: https://github.com/solomon-b/monoidal-functors/blob/main/src... I would say this code is indistinguishable from generics code written by a human. However, this type of code has a tendency to only be writable one way. | |||||||||||||||||||||||||||||
| ▲ | kodoman 9 hours ago | parent [-] | ||||||||||||||||||||||||||||
> Here is an example where I literally just told claude I wanted generic instances for these type classes and we had a brief back and forth about the approach then it one shotted this entire module Yes this is basically what I thought you where doing (what seems to me the correct thing). I have found it's very good at implementing interfaces or in your case type classes and completing generic functions. Though I am not sure if you wrote the type class definitions in this file or not, but sounds like either way you explained what you wanted. Also this sort of Haskell code is well above what I did in Haskell so I can only take your word for it that this is good code and I am sure it is. Though I always use plans like you, and found them to always be good. I have experimented with just asking it to implement features with minimal direct and it does end up being very bad. Particularly in creating data structures/ data types or interfaces and classes. My guess was only that when you try and get the agent to decide stuff like data types and type classes and how to structure the program it does a poor job and worse then if you did it in other languages. | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||