> Yes, in general it's not possible.  That is, I can't write a function
>
>       evaluate :: a -> a
>
> which will force its argument to WHNF.
I don't think you mean what you are actually saying, it's perfectly possible
write evaluate :-)

        evaluate x = x

This function will evaluate its argument when called.

What you cannot write is a function that evaluates its argument completely,
nor to write a function

        evaluate' :: a -> b -> b

which evaluates the first argument to WHNF and returns the second.  For both of
these you can use Kevin's trick.

        -- Lennart


Reply via email to