Question aboutthe use of an inner forall

Simon Peyton-Jones simonpj@microsoft.com
Wed, 28 Aug 2002 12:20:32 +0100


No, this is a bug, thank you.  Will fix.

Simon

| -----Original Message-----
| From: Ashley Yakeley [mailto:ashley@semantic.org]=20
| Sent: 19 August 2002 11:31
| To: Jay Cox; Haskell Cafe List
| Subject: Re: Question aboutthe use of an inner forall
|=20
|=20
| At 2002-08-18 20:19, Jay Cox wrote:
|=20
| >#ST> runST (newSTRef (3::Prelude.Int))
| >#
| >#Ambiguous type variable(s) `a' in the constraint `PrelShow.Show a'=20
| >#arising from use of `PrelIO.print' at <No locn> #In a 'do'=20
| expression=20
| >pattern binding: PrelIO.print it
|=20
| I don't understand this either, actually:
|=20
|   $ ghci -fglasgow-exts -package lang=20
|      ___         ___ _
|     / _ \ /\  /\/ __(_)
|    / /_\// /_/ / /  | |      GHC Interactive, version 5.04,=20
| for Haskell=20
| 98.
|   / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
|   \____/\/ /_/\____/|_|      Type :? for help.
|  =20
|   Loading package base ... linking ... done.
|   Loading package haskell98 ... linking ... done.
|   Loading package lang ... linking ... done.
|   Prelude> :module ST
|   Prelude ST> :type runST
|  =20
|   Inferred type is less polymorphic than expected
|       Quantified type variable `s' escapes
|       Expected type: ST s a -> t
|       Inferred type: (forall s1. ST s1 a) -> a
|   Prelude ST>=20
|=20
| What's up with that? Can't I even look at the type? Is this the=20
| monomorphism restriction or something?
|=20
| --=20
| Ashley Yakeley, Seattle WA
|=20
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe@haskell.org=20
| http://www.haskell.org/mailman/listinfo/haskell-cafe
|=20