r/functionalprogramming • u/n_creep • Sep 02 '25
OO and FP Make Illegal AI Edits Unrepresentable
In a world flooded with AI tooling, (typed) functional programming has even more reasons to shine. Relying more on types and functional patterns can act as a powerful counterbalance to the potential damage that AI-generated code can bring into our codebases.
So here's one way to frame this idea, applying Yaron Minsky's "make illegal states unrepresentable" to a codebase driven by AI agents. If you need more ways to sell your friends on functional programming this approach might prove helpful (the example code is in Java).
Video: https://www.youtube.com/watch?v=sPjHsMGKJSI
Blog post: https://blog.daniel-beskin.com/2025-08-24-illegal-ai-edits
View all comments
Show parent comment
6
u/[deleted] Sep 02 '25
Yep. I would not try to engage with an llm without a hindley-Milner language. I don’t know how people do otherwise. I’ve got my system to a point where I can have Claude pretend to give an input, follow the logic and explain why the incorrect output happened. As a test I pretended I was a beginner . Explain the compiler error, Claude. And it does, in plain English.