summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/deriving/should_run/drvrun002.hs
blob: 26497bd32c9fdf9e5910700cb4a0912ea3218793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- !!! Deriving Show/Read for type with labelled fields.
--     (based on a Hugs bug report.)
module Main(main) where

data Options = 
   Options { s :: OptionKind } 
   deriving (Show, Read)

data OptionKind = 
   SpecialOptions { test :: Int }
   deriving (Show, Read)

x = Options{s=SpecialOptions{test=42}}

main = do
  print x
  print ((read (show x))::Options)