purescript-lazy
purescript-lazy copied to clipboard
Guard against double force with an exception?
If you use Lazy recursively, and make it too strict, you can wind up calling force inside of a force. Currently, this will loop forever (or blow the stack more likely), but should we guard against this and throw an exception? The compiler does this with recursive binding groups (which can appear anywhere), so this isn't really adding exceptions where there otherwise wouldn't be any.
Throwing sounds good to me - an infinite loop is no better than an error, and at least throwing will slightly demystify what the actual problem is.