Веб Зображення Новини Групи Блоги Перекладач Gmail Ще »
Групи, які ви переглядали нещодавно | Довідка | Увійти
Головна сторінка Груп Google
Допис з розмови Overwrite implementation of show function

Переглянути розібране Показувати лише текст повідомлення

Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From: Frank Poettgen <Frank.Poett...@Post.RxWyTxH-AyAzCyHzEyN.de>
Newsgroups: comp.lang.haskell
Subject: Overwrite implementation of show function
Date: Thu, 28 May 2009 19:35:47 +0200
Lines: 14
Message-ID: <7880bfF1kulduU1@mid.dfncis.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.dfncis.de VeH4RYBrBCXJeAVstrkUHgeI7GM1+uAAirhGmLjzQ8MQvdOARBvFBdWUwN
Cancel-Lock: sha1:CjTyNvrTyTXUu0gRTeMbeMzwuWM=
User-Agent: Thunderbird 2.0.0.18 (Windows/20081105)

import Data.Set as Set ( Set, fromList, toList )

test = fromList [fromList [1,2],fromList [3]]

Then 'show test' will result in the following string:
"fromList [fromList [1,2],fromList [3]]"

What I want is something like "[[1,2],[3]]"
Is there a way to overwrite the implementation of the show function?

instance (Show a) => Show (Set a) where
   show x = toList x

-> ERROR Overlapping instances for class "Show"

Створити групу - Групи Google - Домашня сторінка Google - Правила користування послугою - Заява про конфіденційність і нерозголошення інформації
©2009 Google