# Pastebin 4aygJmq9 {-# LANGUAGE FunctionalDependencies, TypeFamilies, UndecidableInstances #-} import Data.Kind (Type) class Foo x y z | x y -> z where class Foo x y (Foo' x y) => F x y where type Foo' x y :: Type instance Foo x y z => F x y where type Foo' x y = z