Suppose that such a āuniversalā type A exists.
Const () is passing, so we get an isomorphism between
forall a. C a => Const () a -> a -- and Const () A -> A
i.e. between (since Const () a is isomorphic to () , and () -> b is isomorphic to b )
forall a. C a => a -- and A
So, if any A exists, it must be isomorphic to forall a. C a => a forall a. C a => a .
Please note that this was your first attempt at a solution - if it does not meet the requirements, then nothing will happen.
Now, in your particular case
forall a. C a => a
roughly, by definition, C (*) [Note: here I mistakenly āforgetā the superclass of the class Floating a , magin the whole argument is much more fragile]
forall a. (Double -> a) -> a
which is isomorphic to Double :
iso :: Double -> forall a. (Double -> a) -> a iso xf = fx osi :: (forall a. (Double -> a) -> a) -> Double osi f = f id
The proof that the above is really an isomorphism is nontrivial - I think that it requires some parametricity, as in "Recursive types for free!" . (The consequences of Yoneda? ... Comments are welcome!)
So, if there is a solution, for your C it should be A ~ Double , up to isomorphism.
(*) I stretch things a bit. I donāt know how to accurately handle Haskellās limited quantification, so I resort to making the dictionary explicit, even if, I think, itās not exactly the same.