theiterators / http4s-stir

http4s-stir offers Pekko HTTP-style (Akka HTTP-style) DSL directives for http4s using cats-effect's IO as an effect system
Apache License 2.0
34 stars 0 forks source link

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

Open winitzki opened 1 year ago

winitzki commented 1 year ago

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. https://github.com/akka/akka-http/pull/1925

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

luksow commented 1 year ago

@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 commented 1 year ago

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.