diff options
Diffstat (limited to 'testsuite/tests/deriving/should_run/drvrun002.hs')
-rw-r--r-- | testsuite/tests/deriving/should_run/drvrun002.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_run/drvrun002.hs b/testsuite/tests/deriving/should_run/drvrun002.hs new file mode 100644 index 0000000000..26497bd32c --- /dev/null +++ b/testsuite/tests/deriving/should_run/drvrun002.hs @@ -0,0 +1,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) |