
29 Nov
2014
29 Nov
'14
7:43 p.m.
Hello all, I have the following code: {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} data Branch = Left | Right type family Product (v :: Branch) (a :: k) (b :: k) :: k where Product Left l r = l Product Right l r = r My goal is to have a thing like that: type family Product (v :: Branch) (a :: k1) (b :: k2) :: (Either k1 k2) where Is it possible to do such a thing? If not I can find a solution with Kind families/Kind pattern matching, but I don't think that exists, am I wrong? Thanks in advance for your help, Regards.