[Haskell-beginners] Why the length function I wrote has such a type signature?

Tom Murphy amindfv at gmail.com
Fri Nov 12 14:14:25 EST 2010


>
>
>>
> And the type signature given by ghci is
>
>> myLength :: (Num t1) => [t] -> t1
>>
>
>
But why is the signature not written as:
myLength :: [t] -> (Num t1) => t1
or something similar?

I thought that the Num typeclass being first implied that it was the
function's first argument.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20101112/896c2084/attachment.html


More information about the Beginners mailing list