summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_compile/syn.hs
blob: 6693db70d94a446bff3bed59803ff6f9deb06130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)