The doc page <a href="http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/kind-polymorphism-and-promotion.html#promotion">http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/kind-polymorphism-and-promotion.html#promotion</a> show that lists are now usable as types.<br>
<br>So I'm trying to make a type level function to test if a type list contains a type. Unless I'm wrong, that calls to the use of a type family.<br><br>{-# LANGUAGE DataKinds, TypeOperators, KindSignatures, TypeFamilies #-}<br>
<br>data HBool = HTrue | HFalse -- Mandatory as Bool type is not currently promoted to a kind<br><br>type family Member x (l :: [*]) :: HBool<br><br>type instance Member x (x ': xs) = HTrue<br>type instance Member x (y ': xs) = Member x xs<br>
type instance Member x (y ': '[]) = HFalse<br><br><br>But the compiler complains about my instance conflicting. Is what I'm trying to do feasible?<br><br>Second question: how can type level tuples (also mentioned in the doc page) be exploited? Aren't they redundant with type-level lists?<br>