On 28-Jul-1998, Dominic Duggan <[EMAIL PROTECTED]> wrote:
> There is no difference between
> 
>    f =  let  m1 = Mt [[0]] :: Matrix Int  in  mm m1 m1 m1
> 
> and 
> 
>    f = (m1 * m1) :: Matrix Int
> 
> aside from the convoluted way of providing the type annotation

Agreed.

> (and the need in the former case to provide a sample value of the 
> intended result type, not a very easy thing to do in most circumstances).

No, providing a sample value is easy:

        sample :: t
        sample = error "don't use this sample value"

This works because the "first argument" technique only uses the type
of the sample, not the value.  Of course, if you provide it this way,
then you need an explicit type annotation on the sample, which sort
of defeats the purpose...

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.


Reply via email to