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

module Ind2_help where

import Data.Kind (Type)

class C a where
  data T a :: Type
  unT :: T a -> a
  mkT :: a -> T a

instance (C a, C b) => C (a,b) where
  data T (a,b) = TProd (T a) (T b)
  unT (TProd x y) = (unT x, unT y)
  mkT (x,y)       = TProd (mkT x) (mkT y)