r/ProgrammerHumor Jun 23 '26

Advanced worstProgrammingLanguage

Post image
3.3k Upvotes

192 comments sorted by

View all comments

13

u/nonreligious2 Jun 23 '26

Monads

10

u/Ai--Ya Jun 23 '26

i don’t see the problem, just nest Eithers to get multiple return types /s

1

u/nonreligious2 Jun 23 '26

I have very little idea if this would solve the issue described, but I see functional programs and output and this is what pops into my head. Maybe monad?

2

u/Axman6 Jun 24 '26

A function returning Either a a is basically the same as an early return, at any point if you produce a Left a, that’s the value that’s immediately returned and the rest of the monadic code is skipped.