Skip to content
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

Split MonadServer m into MonadRequest m and MonadResponse m #28

Open
rashadg1030 opened this issue Oct 17, 2022 · 0 comments
Open

Split MonadServer m into MonadRequest m and MonadResponse m #28

rashadg1030 opened this issue Oct 17, 2022 · 0 comments

Comments

@rashadg1030
Copy link
Contributor

Should look something like:

-- type MonadServer m = (MonadRequest m, MonadResponse m)

class (MonadRequest m, MonadResponse m) => MonadServer m where
  throw :: ...
  next :: ...

class Monad m => MonadRequest m where
  pathParam :: ...
  queryParam :: ...

class Monad m => MonadResponse m where
  write :: forall a. Writeable a => a -> m ()

to make Okapi functions more descriptive and to constrain their abilities accordingly. Inspired by "IO Monad Considered Harmful". Don't know if this would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant