Type class inference trouble

Ken Shan ken@digitas.harvard.edu
Sat, 17 Feb 2001 01:29:05 -0500

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2001-02-16T07:56:42+0000, Marcin 'Qrczak' Kowalczyk wrote:
> > >     test2 =3D apply [int 3] (apply [(+)::Int->Int->Int] [int 5])
> The monomorphism restriction bites again. A variable binding without
> a type signature is monomorphic...

But, but, but... The type *is* monomorphic, in the sense that it can
only be test :: Int, test2 :: [Int]...  *sob*

Then again, this is a conclusion that can only be reached after
dependencies in type classes are taken into account.  Given that
dependencies are an experimental feature, does this count as a bug?
Or should the monomorphism restriction be taken to mean, as Hugs seems
to do, "monomorphism after unification, as in standard Haskell"?

> ghc and nhc98 can be told to ignore the monomorphism restriction.


Edit this signature at http://rodimus.digitas.harvard.edu/cgi-bin/ken/sig
"The day Microsoft makes something that doesn't suck is probably the day
                   they start making vacuum cleaners" - Ernst Jan Plugge

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org