No title

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}

import Data.Kind (Type)

class UseAssociatedKind k k' (t :: k) | k -> k' where
  type AssociatedType k t (x :: k') :: Type

instance UseAssociatedKind (k1 -> k2) Type t where
  type AssociatedType (k1 -> k2) t x = x