summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_compile/syn.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/stranal/should_compile/syn.hs')
-rw-r--r--testsuite/tests/stranal/should_compile/syn.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_compile/syn.hs b/testsuite/tests/stranal/should_compile/syn.hs
new file mode 100644
index 0000000000..6693db70d9
--- /dev/null
+++ b/testsuite/tests/stranal/should_compile/syn.hs
@@ -0,0 +1,15 @@
+-- !!! THIS TEST IS FOR TYPE SYNONIMS AND FACTORISATION IN THEIR PRESENCE.
+
+module Test where
+data M a = A | B a (M a)
+data L a = N | C a (Syn a)
+type Syn b = L b
+
+idL :: L (Syn c) -> L (Syn c)
+idL N = N
+idL (C x l) = C x (idL l)
+
+idM:: M (L (Syn x)) -> M (L (Syn x))
+idM A = A
+idM (B x l) = B (idL x) (idM l)
+