Open belczyk opened 9 months ago
I've been using Wolverine with F# and can confirm that I myself faced frictions with the first two points.
Regarding the first one, I have indeed resorted to putting WolverineHandler attributes on every handler method. I find your idea of expanding the default conventions used by the framework quite a neat solution. As far as i am concerned, I'd suggest adding a default convention matching the below:
The second point is related to the first one I guess. I'd just note that it does not occur if you put an attribute everywhere (not an ideal solution I agree).
In terms of your wrapper solution, someone created a wrapper similar to what you allude to for MartenDb, see the Marten.FSharp library. I just mention it as a potential reference to illustrate what this solution may look like in practice. i'm not sure if the core team would be happy to include such wrappers in the base library though.
Hey folks, I'm very open to making changes to Wolverine to make it be more F# friendly, just need more feedback. And hopefully some help from real F# devs too if anybody is interested in helping out with that
We are building a platform that uses F# on the back-end as well and have used the Wolverine HTTP support and handlers.
With regards to the handler-naming discovery, we get around the multiple-handler method issue by creating a single handler module per handler. This helps organize our code, though I can see the benefit of grouping some handlers together. Having case-insensitive matching for the handler function/method seems like a useful low-cost improvement though.
I'd definitely be interested in some sort of F# wrapper/helper project, but I don't have enough experience with other wrappers to know what would be valuable in that project yet. I'd be happy to contribute to that project if someone wants to start listing out some ideas for what it would contain.
Is your feature request related to a problem? Please describe. I have a mid-sized application that uses event sourcing and a custom mediator. I'd like to rewrite it and use Wolverine and F#. I started PoC and discovered a few problems when using idiomatic F# with Wolverine. Some examples:
let handle (e : MyEvent) = ...
won't work, use of[<WolverineHandler>]
attribute is a solution here but I'm not big fan of F# syntax for attributes)Describe the solution you'd like
Describe alternatives you've considered
The alternative is to use
[<WolverineHandler>]
for every handler method and build a F# friendly wrapper in my solution for Wolverine API (but if I can take advantage of it, probably every F# developer could make use of it).