You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My team (relatively new to Scala) sees this syntax as the biggest pain-point of using Rho, to the point that we ended up defining our own syntax extensions:
Would there be interest in adding alphanumeric methods like these to the main Rho types? I'm thinking we could do something like the new collections did, and:
Add methods with descriptive names to the builder classes
For backwards-compat, change the existing symbolic operators to call the new alphanumeric methods
The text was updated successfully, but these errors were encountered:
I am not opposed to adding some aliases to help reduce confusion.
Personally I like the symbolic operators for their compactness, but I
understand it's not for everyone. I would happily accept a PR for this.
On Fri, May 3, 2019, 9:24 AM Daniel Moran ***@***.***> wrote:
Rho makes heavy use of symbolic operators and extension methods for syntax:
"description" ** routeMap("oauth" -> List("admin")) ^^ route
route >>> headerDecoders
route |>> { () => doThing }// Proposed in #314:List("tag1", "tag2") @@ route
My team (relatively new to Scala) sees this syntax as the biggest
pain-point of using Rho, to the point that we ended up defining our own
syntax extensions:
implicit class BuilderOps[HL <: HList](val builder: PathBuilder[IO, HL]) extends AnyVal {
def withDescription(description: String): PathBuilder[IO, HL] =
new PathBuilder(
builder.method,
PathAST.MetaCons(builder.path, RouteDesc(description))
)
}
implicit class RouteOps[F[_], T <: HList](val route: RouteExecutable[F, T]) extends AnyVal {
def bindAction[U, R](action: U)(implicit hltf: HListToFunc[F, T, U], srvc: CompileRoutes[F, R]): R = route |>> action
}
Would there be interest in adding alphanumeric methods like these to the
main Rho types? I'm thinking we could do something like the new
collections did <scala/collection-strawman#57>,
and:
1. Add methods with descriptive names to the builder classes
2. For backwards-compat, change the existing symbolic operators to
call the new alphanumeric methods
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#315>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIPMKBR7KKP5VTD4YTNVF3PTRDJFANCNFSM4HKULUVA>
.
Rho makes heavy use of symbolic operators and extension methods for syntax:
My team (relatively new to Scala) sees this syntax as the biggest pain-point of using Rho, to the point that we ended up defining our own syntax extensions:
Would there be interest in adding alphanumeric methods like these to the main Rho types? I'm thinking we could do something like the new collections did, and:
The text was updated successfully, but these errors were encountered: