[project @ 2001-08-22 11:45:06 by sewardj]
[ghc-hetmet.git] / ghc / tests / deriving / should_run / drvrun002.hs
1 -- !!! Deriving Show/Read for type with labelled fields.
2 --     (based on a Hugs bug report.)
3 module Main(main) where
4
5 data Options = 
6    Options { s :: OptionKind } 
7    deriving (Show, Read)
8
9 data OptionKind = 
10    SpecialOptions { test :: Int }
11    deriving (Show, Read)
12
13 x = Options{s=SpecialOptions{test=42}}
14
15 main = do
16   print x
17   print ((read (show x))::Options)