3 ms·
Couldn't you return a tuple with the object and the useful return value though?
by Akronymus 6y ago
Couldn't you return a tuple with the object and the useful return value though?
- Smaug123 6y agoSure - that's not the difficult part, in my book. (I use F#, where there's tuple destructuring syntax, so it's easy.) The hard parts are about making sure you can't reuse the token in the wrong context.
- Akronymus 6y agoOooh. Yeah, that makes sense. I sadly don't know enough F# to even begin to think of something to make the tokens context safe.
- Smaug123 6y agoFor what it's worth, I don't think it's possible in F# (perhaps modulo absurd tricks that will never go into prod code, like type-level naturals).