Following is my failing attempt to extract a TypeRef
of b
:
import Data.Typeable
f :: Typeable b => a -> b
f = impl
where
bTypeRep = typeOf $ (undefined :: Typeable b => (a -> b) -> b) impl
impl = undefined
The error message is following:
Could not deduce (Typeable a0) arising from a use of `typeOf'
from the context (Typeable b)
bound by the type signature for f :: Typeable b => a -> b
at src/Xet.hs:14:6-25
The type variable `a0' is ambiguous
What is wrong? How to solve this?