Ghc / Hugs inconsistencty.

Grace Trigue White wpd@uswest.net
Thu, 15 Mar 2001 15:15:13 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_003E_01C0AD62.BB93F4D0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


 The following program compiles under ghc, but hugs complains that there =
is an unexpected keyword "forall" on the line defining the type X. The =
type used is the type of the primitive runST, so it is a valid type. It =
seems that one should be able to create a type synonym for it. The =
situation is unchanged if the type X is given a parameter a, i.e. "type =
X a =3D (forall s. ST s a) -> a".

module Main where

import ST

type Module s a =3D ST s a

type X =3D (forall s. ST s a) -> a
f :: (forall s. ST s a) -> a
f x =3D undefined
--type ModuleConnect =3D forall s. (forall t. ST (s, t) a) -> ST s a

main :: IO ()
main =3D
  do { putStrLn "Hello World!!!"
     }
=20

------=_NextPart_000_003E_01C0AD62.BB93F4D0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3103.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c8e0d8>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;The following program compiles =
under ghc, but=20
hugs complains that there is an unexpected keyword "forall" on the line =
defining=20
the type X. The type used is the type of the primitive runST, so it is a =
valid=20
type. It seems that one should be able to create a type synonym for it. =
The=20
situation is unchanged if the type X is given a parameter a, i.e. "type =
X a =3D=20
(forall s. ST s a) -&gt; a".</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
style=3D"mso-fareast-font-family: 'MS =
Mincho'"></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
style=3D"mso-fareast-font-family: 'MS Mincho'">module Main =
where<BR><BR>import=20
ST<BR><BR>type Module s a =3D ST s a<BR><BR>type X =3D (forall s. ST s =
a) -&gt;=20
a<BR>f :: (forall s. ST s a) -&gt; a<BR>f x =3D undefined<BR>--type =
ModuleConnect=20
=3D forall s. (forall t. ST (s, t) a) -&gt; ST s a<BR><BR>main :: IO =
()<BR>main=20
=3D<BR><SPAN style=3D"mso-spacerun: yes">&nbsp; </SPAN>do { putStrLn =
"Hello=20
World!!!"<BR><SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>}<BR>&nbsp;<?xml:namespace prefix =3D o ns =3D=20
"urn:schemas-microsoft-com:office:office"=20
/><o:p></o:p></SPAN></FONT></DIV></BODY></HTML>

------=_NextPart_000_003E_01C0AD62.BB93F4D0--