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

Use for/yield to define routes instead of akka-style nested calls #4

Open
winitzki opened this issue Aug 31, 2023 · 2 comments
Open

Comments

@winitzki
Copy link

winitzki commented Aug 31, 2023

Some time ago I tried (unsuccessfully) to push akka-http in the direction of for/yield (monadic) DSL.

Here is my rejected PR from 2018.
akka/akka-http#1925

You could consider implementing this. I've been using this monadic DSL in production.

@luksow
Copy link
Collaborator

luksow commented Sep 4, 2023

@winitzki thanks for reaching out!

This indeed looks interesting. Did you release that as a library for akka-http?

As for http4-stir I plan first to reach some maturity and only after that start adding new features. My first idea is to include more directivies (http4s-stir-missing) but I could also release your DSL (http4s-stir-monadic).

I'll keep this open, so that we can get back to it in the future.

@winitzki
Copy link
Author

winitzki commented Sep 5, 2023

I never had any time to release this as a library. The code in that PR is reasonably complete and yet quite small. This idea is simple to implement: directives are a monad that needs a flatMap. You can always add more directives in the future, the monadic wrapper works with any directives.

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

2 participants