Implicit Parameter Bug?

Simon Peyton-Jones simonpj@microsoft.com
Mon, 4 Feb 2002 01:50:58 -0800


This bug is already fixed in 5.02.2, which is available now.

Simon

| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]=20
| Sent: 04 February 2002 02:23
| To: Haskell List
| Subject: Implicit Parameter Bug?
|=20
|=20
| What's wrong with this?
|=20
|     f :: ((?param :: a) =3D> b) -> a -> b
|     f foo a =3D foo with ?param=3Da
|=20
|     g :: (?param :: a) =3D> a
|     g =3D ?param
|=20
|     h :: a -> a
|     h =3D f g
|=20
| 'ghci -fglasgow-exts' (5.02) gives this error:
|=20
|     Could not deduce (?param :: a) from the context ()
|     Probable fix:
|         Add (?param :: a) to the type signature(s) for h
|     arising from use of `g' at Implicit.hs:10
|     In the first argument of `f', namely `g'
|     In the definition of `h': f g
|=20
| 'hugs -98' (Feb 2000) gets as far as this:
|=20
| Reading file "/usr/share/hugs98/lib/Prelude.hs":
| Reading file "Implicit.hs":
| Type checking     =20
|=20
| ...and spins there.
|=20
| There's a workaround for ghci, but it doesn't help hugs:
|=20
|     h :: a -> a
|     h =3D f (g with ?param =3D ?param)
|=20
| This is very odd, as surely the type of (g with ?param =3D=20
| ?param) is the=20
| same as the type of g?
|=20
| --=20
| Ashley Yakeley, Seattle WA
|=20
| _______________________________________________
| Haskell mailing list
| Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
|=20