[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-cafe
Subject: i can't see the solution
From: "Fwd" <misemilios () iespana ! es>
Date: 2001-11-25 10:51:30
Message-ID: 000801c1759f$28307a00$78c5533e () d1u8p2
[Download RAW message or body]
it's an .lhs file
> data Alumno = A { dni :: Integer, nombre :: String,nota::Float }
> shf :: Alumno -> String
> shf alum = 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 => Show (Alumno a) where
> show x = shf x
Thanks .
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>it's an .lhs file</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>> data Alumno = A { dni :: Integer, nombre ::
String,nota::Float }<BR>
<DIV><FONT face=Arial size=2>> shf :: Alumno -> String<BR>> shf
alum = show (dni alum) ++ nombre alum ++ show (nota alum
)</FONT></DIV></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>i don't wanna use this sentence: deriving
Show</FONT></DIV>
<DIV><FONT face=Arial size=2>i wanna use "my show function" but ...</FONT></DIV>
<DIV><FONT face=Arial size=2>Here is the problem !!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>> instance Show a => Show (Alumno
a) where<BR>> show x = shf x </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks .</FONT></DIV></BODY></HTML>
______________________________________________________________________________
mensaje enviado desde http://www.iespana.es
emails (pop)-paginas web (espacio ilimitado)-agenda-favoritos (bookmarks)-foros -Chat
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic