Allow bundling pattern synonyms with exported data families
[ghc.git] / testsuite / tests / patsyn / should_compile / T14058a.hs
1 {-# LANGUAGE GADTs #-}
2 {-# LANGUAGE PatternSynonyms #-}
3 {-# LANGUAGE ScopedTypeVariables #-}
4 {-# LANGUAGE TypeFamilies #-}
5 {-# LANGUAGE TypeInType #-}
6 {-# LANGUAGE TypeOperators #-}
7 module T14058a (Sing(.., SCons)) where
8
9 data family Sing (a :: k)
10
11 data instance Sing (z :: [a]) where
12 SNil :: Sing '[]
13 (:%) :: Sing x -> Sing xs -> Sing (x:xs)
14
15 pattern SCons :: forall a (z :: [a]). ()
16 => forall (x :: a) (xs :: [a]). z ~ (x:xs)
17 => Sing x -> Sing xs -> Sing z
18 pattern SCons x xs = (:%) x xs
19 {-# COMPLETE SNil, SCons #-}