Modify a couple of error messages slightly
[ghc.git] / testsuite / tests / gadt / gadt-dim7.hs
1 {-# LANGUAGE GADTs #-}
2
3 module ShouldSucceed4 where
4
5 data Z
6 data S a
7
8
9 data Add n m r where
10 PZero :: Add Z m m
11 PSucc :: Add n m p -> Add (S n) m (S p)
12
13
14 data XList n a where
15 XNil :: XList Z a
16 XCons :: a -> XList n a -> XList (S n) a
17
18
19 -- simple safe append function
20 append :: (Add n m r) -> XList n a -> XList m a -> XList r a
21 append PZero XNil l = l
22 append (PSucc prf) (XCons x xs) l = XCons x (append prf xs l)
23
24