Re: Inferring types

2000-09-11 Thread Marcin 'Qrczak' Kowalczyk
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

RE: Inferring types

2000-09-11 Thread Chris Angus
> -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: >

Re: Inferring types

2000-09-08 Thread Marcin 'Qrczak' Kowalczyk
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

Re: Inferring types

2000-09-08 Thread Jon Fairbairn
> 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

Re: Inferring types

2000-09-08 Thread Fergus Henderson
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? > >