Commit 10af7cf9 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Add another GADT test

parent 52c36250
......@@ -22,6 +22,8 @@ test('gadt16', normal, compile, [''])
test('gadt17', normal, run_command_ignore_output, ['$MAKE gadt17'])
clean(['Gadt17_help.hi', 'Gadt17_help.o'])
test('gadt18', normal, compile, [''])
test('red-black', normal, compile, [''])
test('type-rep', skip_if_fast, compile_and_run, [''])
test('equal', normal, compile, [''])
......
-- A simple GADT test from Roman
-- which nevertheless showed up a bug at one stage
module ShouldCompile where
data T a where
T1 :: () -> T ()
T2 :: T a -> T b -> T (a,b)
class C a where
f :: T a -> a
instance C () where
f (T1 x) = x
instance (C a, C b) => C (a,b) where
f (T2 x y) = (f x, f y)
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