deeqSeq proposal

John Meacham john at
Tue Apr 4 17:18:24 EDT 2006

On Tue, Apr 04, 2006 at 11:52:55AM -0700, Andy Adams-Moran wrote:
> I'm not convinced Simon's argument holds, as I don't think you can use
> deepSeq to write a Haskell function that will distinguish cyclic
> structures from infinite ones. If we can't do that, then we haven't
> really added any new semantic observational capability to the theory, so
> I think the "morally correct reasoning" argument holds.

compiler optimizations don't necessarily preserve cyclic structures. in
practice they probably do, but there is no guarentee and we wouldn't
want to start making one.

another option would be for the DeepSeq class (or whatver) have a depth
limited version,

deepSeqSome :: DeepSeq a => Int -> a -> a

which would only traverse a limited depth into a structure.

Another issue is that being able to detect cyclic structures would make
it impossible to express deepSeq as a Haskell -> Haskell translation.
which is no good.


John Meacham - ⑆⑆john⑈

More information about the Haskell-prime mailing list