| ▲ | dnautics 11 hours ago | ||||||||||||||||
io is not a monad. theres nothing stopping you from stashing a global io "object" and just passing the global wherever you interface with the stdlib. It's dependency injection. and yes, you can model dependecies like a monad but most people, even in less pure fp langs, don't. i don't really say this to just be a pedant, but if you're an fp enjoyer, you will be disappointed if you get the picture that zig is fp-like, outside of a few squint-and-it-looks-like things | |||||||||||||||||
| ▲ | tux1968 11 hours ago | parent | next [-] | ||||||||||||||||
My reading of the article, was that the author seems to be in search of a new paradigm, that moves beyond what he sees as the limitations of "fp-like" languages as they exist today. His point appears to be that Zig provides the benefits of "fp-like" languages that exist today, while avoiding at least some of the downsides. And he does admit you may have to squint, to appreciate the fp capabilities provided by Zig. | |||||||||||||||||
| |||||||||||||||||
| ▲ | danieltanfh95 10 hours ago | parent | prev [-] | ||||||||||||||||
I am not even sure if its a general pattern (inject any dependency?) or a specific pattern they added to Zig | |||||||||||||||||
| |||||||||||||||||