3 ms·
'You can't have a thunk in such a language that may end up either one thing or another, "depending".' Well, you can, and on a very rare occasion that's what yo
by dllthomas 13y ago
'You can't have a thunk in such a language that may end up either one thing or another, "depending".'
Well, you can, and on a very rare occasion that's what you want (see "amb"), but you should be explicit that that's what you're asking for (and probably why) because those occasions really are pretty rare and usually pretty complicated/subtle.
- jerf 13y agoSimplifications, of course. :) See also "lazy IO" and the joys of "seq" and all the manifold subtleties it has. But I'll stick to my original claim, modified by "in general"... in general, nondeterministic thunks (where "nondeterminism" means "influenced by things that are not immutably set at the function's start of execution" or something like that) is dangerous and almost (but not quite) always wrong.
- dllthomas 13y agoFor sure. I didn't mean it as a gotcha, just raising an interesting (I hope) aside.