deeqSeq proposal

Simon Peyton-Jones simonpj at microsoft.com
Wed Apr 5 11:36:31 EDT 2006


| >> let xs' () = 1 : 2 :  xs' ()
| >> let xs2 = xs'
| >>
| >> let xs = 1 : 2 : xs
| >>
| >> So deepSeq xs2 ==> _|_, but deepSeq xs ==> xs

No, no.  deepSeq of either should be _|_.  

That's easy to achieve, even with the "marking" idea.  Simply do a
depth-first walk, but mark the node *after* traversing all its children,
not before. That way, if there's a cycle you'll diverge, as you should!
But you still get the effect that 	
	deepSeq (deepSeq x) = deepSeq x
(dynamically).

Simon


More information about the Haskell-prime mailing list