[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strictness annotations



I like the idea of having some way to force the evaluation of things in
a functional language.  For example, it seems like a good idea to be
able to force both components of a complex number to be evaluated
always.  However, I see one problem with strictness annotations in a
data declaration.

If we define a function by

>  f (Pair a b) = b

then, when using equational reasoning, it seems pretty reasonable to
argue that the value of

   f (Pair x 5) = 5

However, if x = _|_ and

>  data PairType a b = Pair !a b

and then

   f (Pair x 5) = _|_


Warren