I've separated this from my previous note, because it's about the
precise question of strictness annotations rather than the more general
question of laws.

I would rather tell someone that to define a new type exactly
isomorphic to an old type they need to write

        newtype  Type = Constructor typeexp

then tell them that they need to write

        data  Type = Constructor !typeexp

The latter smacks too much of magic.  This is clearly a matter of
taste, where reasonable people may disagree; I'm just putting forward
my preference.

Paul's suggestion that ! annotations in the type should change the
meaning of a value worries me.  It is bound to make reasoning more
difficult.  Paul, do you have a formal specification of how the type
annotations should affect the semantics?  It would be more in the
spirit of Haskell to require annotations in the function definition,
from which the annotations in the type can be inferred.

Cheers,  -- P

Reply via email to