News for hackers. Stuff that matters.
Re:Code Health: Make Interfaces Hard to Misuse (2018) by Smaug123 on Monday September 07, 2020 @05:52AM (#24398171)
Sure - 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.
Re:Code Health: Make Interfaces Hard to Misuse (2018) by Akronymus on Monday September 07, 2020 @05:59AM (#24398201)
Oooh. Yeah, that makes sense.

I sadly don't know enough F# to even begin to think of something to make the tokens context safe.

Re:Code Health: Make Interfaces Hard to Misuse (2018) by Smaug123 on Monday September 07, 2020 @11:54AM (#24400237)
For 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).