Commit c9ad5ddd authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Add test for data instances that are GADTs

parent f4b72c61
{-# LANGUAGE TypeFamilies #-}
module TF_GADT where
-- Check that type families can be declared in GADT syntax
-- and indeed *be* GADTs
data family T a
data instance T [a] where
T1 :: a -> T [a]
data instance T (Maybe a) where
T3 :: Int -> T (Maybe Int)
T4 :: a -> b -> T (Maybe (a,b))
f :: a -> T (Maybe a) -> T (Maybe a)
f x (T3 i) = T3 x
f x (T4 p q) = T4 p (snd x)
......@@ -125,3 +125,4 @@ test('T2627', normal, compile, [''])
test('T2448', normal, compile, [''])
test('T2291', normal, compile, [''])
test('T2639', normal, compile, [''])
test('TF_GADT', normal, compile, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment