-
-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing MonadBase instance for ClientM #663
Comments
For the record, |
Hmm. Maybe it can be made so |
I was thinking something more along the line of |
@edsko On the other hand, I'm not sure there is that many applications having client HasServer CustomCombinator :> api where
type ServerT (CustomCombinator :> api) m = ServerT api (CustomT m) as in practice you have to run the In fact, all combinators in class HasServer api where
type ServerM api :: *
route ::
Proxy api
-> Context context
-> Delayed env (ServerM api)
-> Router env Also if you want to do something like that for |
And to return to this issue: @alpmestan I'm very lenient with adding "not far from Haskell Platform" upto |
No, but in the server it's easy to replace the underlying monad completely (which I do all the time since |
While we're at it, this instance is also missing (and it wrecks my head every time I have to define it :) type ClientM' = ReaderT ClientEnv (ExceptT ServantError IO)
instance MonadBaseControl IO ClientM where
type StM ClientM a = StM ClientM' a
liftBaseWith :: (RunInBase ClientM IO -> IO a) -> ClientM a
liftBaseWith f = ClientM (liftBaseWith (\g -> f (g . runClientM')))
restoreM :: StM ClientM a -> ClientM a
restoreM st = ClientM (restoreM st) |
That one relies on |
To be entirely honest, I don't feel like it's appropriate to reject instances that "force" us to bring in 2 more small deps, when our transitive dependency chain is so large already. I mean, we should not be looking to double the number of transitive deps for servant, but sensible instances that are needed and that don't make us pull another 20 deps should be accepted IMO. Regarding the policy itself, I think that's pretty close to what we've been doing so far, but it's not set in stone :) |
@edsko do you want to make a PR? |
Thanks @phadej ! |
It's easily defined
but I don't know if this will cause an additional unwanted dependency.
Incidentally, why is the
ClientM
monad hardcoded? It would be nicer if we could define our own, just like we can for the server.The text was updated successfully, but these errors were encountered: