Mon, 11 Sep 2000 08:51:52 +0100, Chris Angus <[EMAIL PROTECTED]> pisze:
> > Some people think that the monomorphism restriction should be removed.
> > (There are no technical problems with this AFAIK.)
>
> I was under the impression that this introduced to increase efficency
> (prevents the sam
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 08 September 2000 17:17
> To: [EMAIL PROTECTED]
> Subject: Re: Inferring types
>
>
> Sat, 9 Sep 2000 00:56:46 +1100, Fergus Henderson
> <[EMAIL PROTECTED]> pisze:
>
Sat, 9 Sep 2000 00:56:46 +1100, Fergus Henderson <[EMAIL PROTECTED]> pisze:
> If you define `p' as a syntactic function, e.g.
> then the monomorphism restriction does not apply, and so the type inferred
> for `p' will be the correct polymorphic type `Num a => a -> a -> a'.
Also when an explicit
> If you define `p' as a syntactic function, e.g.
>
> p x y = x + y
> or
>
> p x = (+) x
>
> rather than via
>
> p = (+)
>
> then the monomorphism restriction does not apply, and so the type inferred
> for `p' will be the correct polymorphic type `Num a => a -> a -> a'.
Ma
On 08-Sep-2000, Jan Carlson <[EMAIL PROTECTED]> wrote:
> I'm intrigued by the following Haskell behaviour:
>
> The type of (+) is
>
> (+) :: (Num a) => a -> a -> a
>
> Now, if I define
>
> p = (+)
>
> the type of p is inferred to be
>
> p :: Integer -> Integer -> Integer
>
> How come?
>
>