Type class inference trouble

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


--ZPt4rx8FFjLCG7dd
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.

Thanks!

--=20
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

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

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

iD8DBQE6jhoxzjAc4f+uuBURAuSxAKDXOK8/4kU1iSmhm2dzN1vWdC6oUACgzkCo
awO+evcWzRsAu31eD4gfBQM=
=+xyx
-----END PGP SIGNATURE-----

--ZPt4rx8FFjLCG7dd--