This sounds interesting. Can you link to any examples?
Go through
https://fsharpforfunandprofit.com/fppatterns/
And
https://fsharpforfunandprofit.com/posts/13-ways-of-looking-a...
I'm still learning on how to apply these ideas in my own work (which doesn't use f sharp or functional programming) but it's a rich source of ideas
Finally create decoders that instantiate those types from different sources.