Lets say we have the following code:
class C t where g :: t instance C Int where g = 42
Simple. We can also define functions on Int, like
The following file compiles here:
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies #-} class C a where g :: a type family X type instance X = Int newtype NewX = NewX X deriving Num instance C NewX where g = 43