
7 May
2008
7 May
'08
11:35 a.m.
Abhay Parvate wrote:
Just for curiocity, is there a practically useful computation that uses 'seq' in an essential manner, i.e. apart from the efficiency reasons?
I don't think so because you can always replace seq with const id . In fact, doing so will get you "more" results, i.e. a computation that did not terminate may do so now. In other words, we have seq _|_ = _|_ seq x = id for x > _|_ but (const id) _|_ = id (const id) x = id for x > _|_ So, (const id) is always more defined (">") than seq . For more about _|_ and the semantic approximation order, see http://en.wikibooks.org/wiki/Haskell/Denotational_semantics Regards, apfelmus