i can't see the solution
Fwd
misemilios@iespana.es
Sun, 25 Nov 2001 11:51:30 +0100
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C175A7.85CBD1C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
it's an .lhs file
> data Alumno =3D A { dni :: Integer, nombre :: String,nota::Float }
> shf :: Alumno -> String
> shf alum =3D show (dni alum) ++ nombre alum ++ show (nota alum )
i don't wanna use this sentence: deriving Show
i wanna use "my show function" but ...
Here is the problem !!
> instance Show a =3D> Show (Alumno a) where
> show x =3D shf x=20
Thanks .
------=_NextPart_000_0005_01C175A7.85CBD1C0
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 http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>it's an .lhs file</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>> data Alumno =3D A { dni :: =
Integer, nombre ::=20
String,nota::Float }<BR>
<DIV><FONT face=3DArial size=3D2>> shf :: Alumno -> String<BR>> =
shf=20
alum =3D show (dni alum) ++ nombre alum ++ show (nota alum=20
)</FONT></DIV></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>i don't wanna use this sentence: =
deriving=20
Show</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i wanna use "my show function" but =
...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Here is the problem !!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>> instance Show a =3D> Show =
(Alumno =20
a) where<BR>> show x =3D shf x =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks .</FONT></DIV></BODY></HTML>
------=_NextPart_000_0005_01C175A7.85CBD1C0--
______________________________________________________________________________
mensaje enviado desde http://www.iespana.es
emails (pop)-paginas web (espacio ilimitado)-agenda-favoritos (bookmarks)-foros -Chat