summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/ColInference4.hs
blob: 27675b10514afd4852eb51041a39eaf8f96eefc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE TypeFamilies #-}

module ColInference  where 

type family Elem c

type instance Elem [e] = e

class Col c where
 isEmpty   :: c -> Bool
 add       :: c -> Elem c -> c
 headTail  :: c -> (Elem c,c)

sawpOne c1 c2 
	= let (x,c1') = headTail c1
              (y,c2') = headTail c2
	  in (add c1' y,add c1' x)