The documentation claim that "The default implementation of 'deepseq' is simply 'seq'" is not exactly right, as `deepseq` and `seq` have different signatures.

Yes indeed. In order to use deepseq, it looks like I also need some way to force the () return value, e.g.

    let res = deepseq (my big computation)
    in res `seq` use res

or

    let res = deepseq (my big computation)
    in case res of () -> use res

I suppose the advantage of this approach is to ensure that the user must let-bind the forced value to a name. A beginner might write
    (my big computation) `seq` use (my big computation)
without realising that it fails to do what they desire.

Regards,
    Malcolm

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to