----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 9


During compilation of the enclosed module, the following happened:

panic! (the `impossible' happened):
	tcInstType:1

Herewith reported as a GHC 2.04 bug.

Einar
----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: GUIValue.hs
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 38

module GUIValue (
	GUIVALUE(..), 
	GUIValue(..)

	) where

import Char

data GUIVALUE = GUIVALUE String

class (Show a, Read a) => GUIValue a where
	cdefault :: a
	cshow :: a -> String
	cread :: String -> a
	creadIO :: String -> IO a
	cread = read
	cshow = show
	creadIO = readIO

toGUIValue :: GUIValue a  => a -> GUIVALUE
toGUIValue = GUIVALUE . cshow	

fromGUIValue :: GUIValue a  => GUIVALUE -> a
fromGUIValue (GUIVALUE str) = cread str

instance GUIValue a => GUIValue [[Char]] where
	cdefault = []
	cread = lines . cread 
	cshow = cshow . unlines

instance GUIValue a => GUIValue [a] where
	cdefault = []
	cread str = map cread (lines str) 
	cshow l = unlines (map cshow l)




Reply via email to