I'm writing a library that abstracts over some f :: * -> *, and f makes the most sensible type for the tag. Attempting to use f as the tag for, say, MonadState, results in a type error. Simple example:
class MyClass s f where
myMethod :: MonadState f s m => f a -> m a
Granted, in this case, I can just use f () as the tag instead of f, but I don't fee like that's a real solution. It would be nice if I could just use f on its own, and manually pass Proxy :: Proxy f to the StateT methods.
I'm writing a library that abstracts over some
f :: * -> *
, andf
makes the most sensible type for the tag. Attempting to usef
as the tag for, say,MonadState
, results in a type error. Simple example:Granted, in this case, I can just use
f ()
as the tag instead off
, but I don't fee like that's a real solution. It would be nice if I could just usef
on its own, and manually passProxy :: Proxy f
to the StateT methods.