[Haskell-beginners] Show for Parameterized Type
David Place
d at vidplace.com
Mon Aug 8 00:02:19 CEST 2011
On Aug 7, 2011, at 5:54 PM, Hartmut wrote:
> David,
> that was fast :-) Thank you for your help!
> Hartmut
Your welcome. ;-) I needed the break from what I was doing. I think I actually would like to add that normally i wouldn't put the class constraints in the data type definition.
module Main where
data EW a = EW a
x01 = EW 20
x02 = EW "Test"
instance (Show a) => Show (EW a) where
show (EW x) = show "EW:" ++ show x
instance (Read a) => Read (EW a) where
read (etc...)
____________________
David Place
Owner, Panpipes Ho! LLC
http://panpipesho.com
d at vidplace.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110807/f40ea67e/attachment-0001.htm>
More information about the Beginners
mailing list