| ▲ | kccqzy 5 hours ago | ||||||||||||||||||||||||||||
I noticed that AI likes to overuse foldl' and foldr (especially foldr) including analogous versions on Maps, even when there are simpler and more straightforward ways to achieve the same thing. When AI writes foldr with a complicated accumulation function, I’d prompt AI to define a custom monoidal structure and then use foldMap. Then the reader doesn’t have to think about the asymmetric accumulation function and instead think about the mapping operation and the associative combine function separately. Factoring out the two jobs of the accumulation function is a great trick to improve readability: excellent tradeoff if the human is mostly reading the code. | |||||||||||||||||||||||||||||
| ▲ | Drupon 4 hours ago | parent [-] | ||||||||||||||||||||||||||||
Doesn't using AI render the main advantage of Haskell (telling everyone you can write software in Haskell) somewhat pointless? | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||