I'm in the process of designing a .NET API to allow developers to create RoboCup agents for the 3D simulated soccer league.
I'm pretty happy with how the API work with C# code, however I would like to use this project to improve my F# skill (which is currently based on reading rather than practice).
So I would like to ask what kinds of things I should consider when designing an API that is to be consumed by both C# and F# code.
Some points.
IAgent), using instances of their implementations (eg: MyAgent) to construct other API classes (eg: new Client(myAgent)).I'd like to release a version of the API as soon as possible and don't want to make major changes to it later if I realise it's too difficult to work with from F#. Any advice is appreciated.
The best advice is probably to try using the API from F#. :)
That said, I think what you have sounds fine
Func/Action at the boundary, but there's nothing you would change here|>ignores)But really, take an hour and try writing an F# consumer of the library. In all likelihood, in the worst case, you might suggest a few helper functions or extension methods for F# to smooth over any friction points at the interface boundary, but I think what you have should all just be fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With