3 ms·
> You make a lazy function strict by asking for its output now rather than later. That doesn't mean you can evaluate the function strictly. Have a look at thi
by eru 3y ago
> You make a lazy function strict by asking for its output now rather than later.
That doesn't mean you can evaluate the function strictly. Have a look at this example:
f = head . map (2+)
x = f [5, undefined]
You can ask for x right away (it's 7), but if you evaluate f strictly, it still diverges.
In any case, my suggestion is not to deal with arbitrary functions; but to restrict the set of untagged functions to those where any evaluation order works. 'Works' in the sense that any evaluation order takes a finite amount of time.