I'm the CTO at my place of work, and our primary app is C#. I wanted to tame some of the excesses of the language, and started looking at Haskell - I knocked up a few small projects with it; got it talking to the C# app through RabbitMQ, all happy days. But a few months later I came back to the projects to find they had rotted because of cabal. Some projects I found it next to impossible to recover. That left a pretty sour taste, which was gutting because I loved the language.
Then I took a look at F#. It's not as impressive as Haskell as a language, but it really does sit in that sweet spot for 'fitting in' to a big project environment. I've found that creating satellite projects to our core app in F# has been the perfect way to go. It's moved the team into that mindset slowly without having to force the issue.
Can you elaborate on how that is laid out? I've identified some existing C# code in various of our current projects that could benefit from conversion to F#, but I'm not sure how the resulting projects should be structured.
Other projects are separate microservices that talk to our main app through my messaging framework [1]. It's an actor-model that I built a C# and F# API for, and they communicate via Redis. But tbh you can use anything you like: make it RESTful, use WebServices, RabbitMQ, etc. The great thing is you have access to the same libraries on both languages.
If you're thinking of refactoring existing projects then you could go the mechanical route of just converting classes like-for-like. But you miss out on some of the amazing type system benefits of F# if you do that.
What I tend to do is design all of the types first, as records or discriminated unions. A bit like if you were doing a DB related project you might spend some time designing the schema first, thinking about how the data should be laid out. With ADTs you can design the states of your application, whatever it is, and then you write the functions that transform those states in a referentially transparent way.
Then you book-end your lovely functional code with the IO.
This whole process is much simpler when you start with smaller services; so if you've found sections of your existing app that you want to break out, then that's perfect.
By the way, if you want some of the functional niceness in C# too, then check my library below. It was built with your situation in mind (because it's mine too). It also has some utility functions for F#/C# interop.
fsharpforfunandprofit.com is always a good place for general advice on this:
https://fsharpforfunandprofit.com/posts/porting-to-csharp-in...
Although with C#'s the direction of travel (bringing in pattern matching, record types, etc.) I reckon C# and F# will end up more like Scala and OCaml, rather than Java and OCaml.
Something to think about, since I'm thinking of swapping out some problematic C# code for F#. Pattern matching and a stronger, more expressive type system would be very nice. F# isn't as far off the reservation as Haskell, but I'm not sure how well throwing a monkey wrench, at the team will go.