[Haskell-cafe] automatic instance derivation

Greg Fitzgerald garious at gmail.com
Fri Aug 18 19:42:45 EDT 2006

How do you automatically derive an instance for a data type defined in an
imported module?

-- automatic instance derivation directly after type declaration
data Val1 = V1 Int deriving Show

-- manual instance derivation can be in separate file
data Val2 = V2 Int
instance Show Val2 where
   show (V2 i) = show i

-- Is something like this possible?
data Val1 = V1 Int
derive Show Val2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060818/cb0fa830/attachment.htm

More information about the Haskell-Cafe mailing list