Strict tuples

Ben Rudiak-Gould Benjamin.Rudiak-Gould at
Wed Mar 22 21:14:17 EST 2006

John Meacham wrote:
> ghc's strictness analyzer is pretty darn good, If
> something is subtle enough for the compiler not to catch it, then the
> programmer probably won't right off the bat either.

Even the best strictness analyzer can't determine that a function is strict 
when it really isn't. The main point of strictness annotations, I think, is 
to actually change the denotational semantics of the program.

> strictness does not belong in the type system in general. strictness
> annotations are attached to the data components and not type components
> in data declarations because they only affect the desugaring of the
> constructor, but not the run-time representation or the types in
> general. attaching strictness info to types is just the wrong thing to
> do in general I think.

Your argument seems circular. Haskell 98 strictness annotations are just 
sugar, but they didn't *have* to be. You can say that f is strict if f _|_ = 
_|_, or you can say it's strict if its domain doesn't include _|_ at all. 
One feels more at home in the value language (seq, ! on constructor fields), 
the other feels more at home in the type language (! on the left of the 
function arrow, more generally ! on types to mean lack of _|_).

-- Ben

More information about the Haskell-prime mailing list