summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/typecheck/should_compile/tc221.hs
blob: 903b2bc3ac0cbc874db502e8bc5a701a6b587cb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE GADTs #-}

-- A program very like this triggered a kind error with GHC 6.6

module Foo where

data PatchSeq p a b where
    Nil   :: PatchSeq p a b
    U  :: p a b -> PatchSeq p a b
    (:-)  :: PatchSeq p a b -> PatchSeq p b c -> PatchSeq p a c

-- is_normal :: PatchSeq p a b -> Bool 
is_normal Nil = True 
is_normal (U _) = True 
is_normal (U _ :- _) = True 
is_normal _ = False