rl at cse.unsw.edu.au
Thu Apr 13 00:13:29 EDT 2006
On Tue, 2006-04-11 at 09:53 +0100, Simon Peyton-Jones wrote:
> Whether it should be in a class is a rather separate discussion. In a
> way we already sold out when we allowed seq to escape from the
> type-class world. Perhaps deepSeq is worse (because it traverses data
> structures) but not obviously.
I think it is much worse because it completely breaks encapsulation if
it is not in a class. For instance, is it safe to apply deepSeq to the
result of Data.Map.empty? To 'Data.Array.array (0,10) '? The
documentation does not say, and for good reasons - whether an abstract
data type uses bottoms in its representation shouldn't be of any concern
to the clients. Bottoms become detectable, however, if the default
behaviour of deepSeq cannot be overridden.
More information about the Haskell-prime