For my vile and mostly obscure reasons, I decided to want a level type that indicates the presence of an instance of a type class for the type. It will work as follows:
> :kind! HasClass Show Int
> 'True
> :kind! HasClass Monoid Int
> 'False
Given that types of restrictions, etc. added to the GHC recently, I get the feeling that this is possible, but it doesn’t come to my mind not every neat implementation. It can be done?
source
share