Question aboutthe use of an inner forall

Simon Peyton-Jones simonpj@microsoft.com
Thu, 29 Aug 2002 15:10:03 +0100


Now fixed in the 5.04 branch.   The fix will get into the HEAD when=20
I merge in the Template Haskell stuff.

Thanks for the report

Simon


| -----Original Message-----
| From: Simon Peyton-Jones [mailto:simonpj@microsoft.com]=20
| Sent: 28 August 2002 12:21
| To: Ashley Yakeley
| Cc: Haskell Cafe List
| Subject: RE: Question aboutthe use of an inner forall
|=20
|=20
| No, this is a bug, thank you.  Will fix.
|=20
| Simon
|=20
| | -----Original Message-----
| | From: Ashley Yakeley [mailto:ashley@semantic.org]
| | 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'
| | >#arising from use of `PrelIO.print' at <No locn> #In a 'do'=20
| | expression
| | >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
| | 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
| | What's up with that? Can't I even look at the type? Is this the
| | monomorphism restriction or something?
| |=20
| | --
| | Ashley Yakeley, Seattle WA
| |=20
| | _______________________________________________
| | Haskell-Cafe mailing list
| | Haskell-Cafe@haskell.org
| | http://www.haskell.org/mailman/listinfo/haskell-cafe
| |=20
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe@haskell.org=20
| http://www.haskell.org/mailman/listinfo/haskell-cafe
|=20