wrong infered types?
"Paqui Lucio" <[email protected]> Fri, 11 Jan 2008 16:49:26 +0100
| Newsgroups | gmane.comp.lang.haskell.hugs.user |
|---|---|
| Message-ID | <005501c85469$8b358960$a471e39e@SIPC64> |
This is a multi-part message in MIME format.
--===============0562172626==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0056_01C85471.ECF9F160"
This is a multi-part message in MIME format.
------=_NextPart_000_0056_01C85471.ECF9F160
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,=20
In Hugs, the infered types for the following four functions:=20
f a =3D let m =3D id a in do return m=20
f' a =3D do m <- id a=20
return m=20
g a =3D let m =3D[a,a] in do return m=20
g' a =3D do m <- [a,a]=20
return m=20
respectively are=20
f :: Monad a =3D> b -> a b=20
f' :: Monad a =3D> a b -> a b=20
g :: Monad a =3D> b -> a [b]=20
g' :: a -> [a]=20
I didn't expect this types, do you?=20
Anybody has some explanation?=20
Thanks in advance,=20
Paqui
---------------------------------=20
Paqui Lucio =20
Dpto de LSI =20
Facultad de Inform=E1tica
Paseo Manuel de Lardizabal, 1
20080-San Sebasti=E1n
SPAIN
---------------------------------
e-mail: [email protected]
Tfn: (+34) (9)43 015049 =20
Fax: (+34) (9)43 015590
Web: http://www.sc.ehu.es/paqui
---------------------------------
------=_NextPart_000_0056_01C85471.ECF9F160
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7036.0">
<TITLE>wrong infered types?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">Hi,</FONT><FONT =
FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">In Hugs, the infered types =
for the following four functions:</FONT> </SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">f a =3D let m =
=3D id a in do return m</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">f' a =3D do m <- id =
a</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier =
New"> return =
m</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">g a =3D let m =3D[a,a] in do =
return m</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">g' a =3D do m <- =
[a,a]</FONT><BR>
<FONT SIZE=3D2 FACE=3D"Courier =
New"> return =
m</FONT><FONT FACE=3D"Times New Roman"> </FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">respectively =
are</FONT> </SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">f :: Monad a =
=3D> b -> a b</FONT><BR>
<FONT SIZE=3D2 FACE=3D"Courier New">f' :: Monad a =3D> a b -> a =
b</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">g :: Monad a =3D> b -> =
a [b]</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">g' :: a -> [a]</FONT> =
</SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">I didn't =
expect this types, do you?</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">Anybody has some =
explanation?</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">Thanks in =
advance,</FONT><FONT FACE=3D"Times New Roman"><BR>
</FONT><FONT SIZE=3D2 FACE=3D"Courier New">Paqui</FONT></SPAN>
</P>
<P><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier =
New">--------------------------------- </FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">Paqui =
Lucio &n=
bsp; &nb=
sp; </FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">Dpto de =
LSI &nbs=
p; </FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">Facultad de =
Inform=E1tica</FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">Paseo Manuel =
de Lardizabal, 1</FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">20080-San =
Sebasti=E1n</FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier =
New">SPAIN</FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier =
New">---------------------------------</FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">e-mail: =
[email protected]</FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">Tfn: (+34) =
(9)43 015049 </FONT></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier New">Fax: (+34) =
(9)43 015590</FONT></SPAN>
<BR><SPAN LANG=3D"en-gb"><FONT SIZE=3D2 FACE=3D"Courier New">Web: =
</FONT></SPAN><A HREF=3D"http://www.sc.ehu.es/paqui"><SPAN =
LANG=3D"en-gb"><U><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier =
New">http://www.sc.ehu.es/paqui</FONT></U></SPAN></A><SPAN =
LANG=3D"en-gb"></SPAN>
<BR><SPAN LANG=3D"es"><FONT SIZE=3D2 FACE=3D"Courier =
New">---------------------------------</FONT></SPAN>
</P>
</BODY>
</HTML>
------=_NextPart_000_0056_01C85471.ECF9F160--
--===============0562172626==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Hugs-Users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/hugs-users
--===============0562172626==--