summaryrefslogtreecommitdiff
path: root/testsuite/tests/parser/should_run/operator.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/parser/should_run/operator.hs')
-rw-r--r--testsuite/tests/parser/should_run/operator.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_run/operator.hs b/testsuite/tests/parser/should_run/operator.hs
new file mode 100644
index 0000000000..5a7bcf9e97
--- /dev/null
+++ b/testsuite/tests/parser/should_run/operator.hs
@@ -0,0 +1,23 @@
+module Main where
+
+data Hash = Hash { (#) :: Int }
+ deriving (Show,Read)
+
+main = do
+ let h = Hash 3
+ s = show h
+ x = read s :: Hash
+ y = show x
+ print h
+ putStrLn s
+ print x
+ putStrLn y
+ let h' = Hash { (#) = 3 }
+ s' = show h'
+ x' = read s' :: Hash
+ y' = show x'
+ print h'
+ putStrLn s'
+ print x'
+ putStrLn y'
+